|
From: Gait B. <gai...@ti...> - 2005-08-30 20:38:47
|
that means you received a message with the below settings, but you have
not registered a listener that is willing to pick it up.
You'll need to create and register a listener to pick it up. It doesn't
need to run continuously (once registered, Hermes will keep it for you
until it expires and deliver when the listener is started).
Note: you can use wildcards ("*") for the ApplicationContext parameters
to allow for catchall/catchmany behaviour.
Here's a snippet of a listener that you might use (reusing a handler I
called reflector)..
import hk.hku.cecid.phoenix.message.handler.*;
import hk.hku.cecid.phoenix.message.packaging.*;
public class reflector implements MessageListener {
private Request mshReq = null;
public static void main(String[] args) {
reflector reflector = new reflector();
reflector.run(args);
}
public void run(String[] args) {
try {
System.out.println("Reflector setting up...");
String cpaID = "S1633A8751";
String conversationID = "*";
String service = "urn:nhs:names:services:mm";
String action = "PORX_IN260101UK04";
ApplicationContext ac =
new ApplicationContext(cpaID, conversationID, service,
action);
String transportType = "HTTP";
String toMshUrl = "http://localhost:8080/msh/";
mshReq = new Request(
ac, new URL(toMshUrl), this, transportType,
Request.DEFAULT_RETRIES, Request.DEFAULT_RETRY_INTERVAL,
Request.SYNC_REPLY_MODE_SIGNALS_ONLY,
Request.DEFAULT_MESSAGE_ORDER_SEMANTICS,
Request.DEFAULT_PERSIST_DURATION );
System.out.println(
"Reflector set up complete, listening forever...");
while (true) {
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
/*
try {
if (mshReq != null) {
mshReq.unregister();
}
} catch (Exception e) {
e.printStackTrace();
}
*/
}
public URL getClientUrl() {
return null;
}
public void onMessage(EbxmlMessage ebxmlMessage) {
try {
System.out.println(
"Reflector received a message, id = "
+ ebxmlMessage.getMessageId());
/* Do something useful here */
} catch (Exception e) {
e.printStackTrace();
}
}
}
--Gait.
Wahid Muhammad wrote:
> I have had this problem with recieiving messages....
>
>
>
> I have just noticed that the logs are telling me:
>
>
>
> [10012] Unknown application context - (CPAId)=S1633A8751,
> (ConversationId)=0AB350F0-714B-11D9-8D06-001143D115F2,
> (Service)=urn:nhs:names:services:mm, (Action)=PORX_IN260101UK04
>
>
>
> What exactly does this mean, and how can I solve it? As I think this
> is stopping the message handler from receiving the messages.
>
>
>
> Thanks
>
>
>
> Wahid
>
|