[
https://issues.apache.org/jira/browse/AXIS2-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480121
]
John Turner commented on AXIS2-2266:
I implemented this by updating the JMSSender as outlined below. From the
client I invoke
stub._getServiceClient().getServiceContext().setProperty(
"transport.jms.ReplyTo", "jms.responseQueue");
where jms.ResponseQueue is the JNDI name of the response queue.
I modified JMSSender.invoke as follows:
MessageProducer producer = session.createProducer(dest);
Destination replyDest = null;
if (waitForResponse) {
try {
String replyToJNDIName =
(String)
msgContext.getProperty("transport.jms.ReplyTo");
if (replyToJNDIName != null && replyToJNDIName.length() >
0) {
Hashtable props =
JMSUtils.getProperties(targetAddress);
String jndiFactoryClass =
(String) props.get("java.naming.factory.initial");
try {
Class clazz = Class.forName(jndiFactoryClass);
InitialContextFactory initialContextFactory =
(InitialContextFactory) clazz.newInstance();
Context context =
(Context)
initialContextFactory.getInitialContext(props);
replyDest =
(Destination) context.lookup(replyToJNDIName);
} catch (Exception e) {
throw new AxisFault(e);
}
} else {
// create temporary queue to receive reply
replyDest = session.createTemporaryQueue();
}
message.setJMSReplyTo(replyDest);
} catch (JMSException e) {
handleException("Error creating temporary queue for
response");
}
}
I appreciate this is probably not the best way to do this (doing JNDI lookup
each time etc.) and I'm not sure if this is how to use the service context but
its a start for whoever is going to look at it. Also, the above requires that
the JMS connection is the same for the request and response.
> Permanent JMS Response Queue
>
>
> Key: AXIS2-2266
> URL: https://issues.apache.org/jira/browse/AXIS2-2266
> Project: Axis 2.0 (Axis2)
> Issue Type: Improvement
> Components: transports
>Affects Versions: 1.1.1
> Environment: Windows XP
>Reporter: John Turner
>
> When using the JMS transport a service client stub specifies a temporary JMS
> queue as the ReplyTo destination. A useful feature would be to be able to
> configure a permanent ReplyTo queue for the generated client stub and the
> service endpoint. In a request/response communication the association would
> be made through the message id or correlation id.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]