Chamikara
On 8/21/06, Thomas McKiernan <[EMAIL PROTECTED]
> wrote:
Hi everyone,
The following code in Sandesha has caused us some problems:
MessageContext requestMsgCtx = msgCtx.getOperationContext().getMessageContext(
OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
if (requestMsgCtx != null) { // for the server side
RMMsgContext reqRMMsgCtx = MsgInitializer.initializeMessage(requestMsgCtx);
Sequence sequencePart = (Sequence) reqRMMsgCtx
.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
if (sequencePart != null)
msgProcessor = new ApplicationMsgProcessor();// a rm
// intended
// message.
} else if (!msgCtx.isServerSide()) // if client side.
msgProcessor = new ApplicationMsgProcessor();
} else {
msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
}
We are finding that requestMsgCtx is non-null for a client side request. Therefore the code assumes it is a server side and tries to process accordingly, which causes problems.
A workaround seems to be to change the code to the following:
if (msgCtx.isServerSide()) { // for the server side
RMMsgContext reqRMMsgCtx = MsgInitializer.initializeMessage(requestMsgCtx);
Sequence sequencePart = (Sequence) reqRMMsgCtx
.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
if (sequencePart != null)
msgProcessor = new ApplicationMsgProcessor();// a rm
// intended
// message.
}
else // if client side.
msgProcessor = new ApplicationMsgProcessor();
Are there any side effects of this change? Is this change still correct code?
Many thanks,
Tom
----------------------------------
Thomas McKiernan
WebSphere Messaging Development,
IBM United Kingdom Limited
Internal Phone: 248241
External Phone: +44 (0)1962 818241
Mobile: +44 (0)789 1737497
Email: [EMAIL PROTECTED]
Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21 2JN
Caminante, no hay camino
Se hace camino al andar.
("Walker, there is no path; the path is made by walking.") Antonio Machado
