[
http://jira.jboss.com/jira/browse/JBESB-652?page=comments#action_12367512 ]
Daniel Bevenius commented on JBESB-652:
---------------------------------------
Just some more details for this.
I would like the route method to be updated like this:
if (message instanceof org.jboss.soa.esb.message.Message) {
- message = Util.serialize((org.jboss.soa.esb.message.Message)message);
+ org.jboss.soa.esb.message.Message esbMsg =
(org.jboss.soa.esb.message.Message)message;
+ message = Util.serialize(esbMsg);
jmsMessage = createObjectMessage(message);
+ setJMSProperties ( jmsMessage, esbMsg );
} else if(message instanceof String) {
jmsMessage = queueSetup.jmsSession.createTextMessage();
And add this method
protected void setJMSProperties( Message jmsMessage, org.jboss.soa.esb.message.Message
esbMsg ) throws JMSException { }
And a subclass could look like this:
public class JMSCorreletionRouter extends JMSRouter
{
public JMSCorreletionRouter(ConfigTree propertiesTree) throws ConfigurationException,
NamingException, JMSException
{
super( propertiesTree );
}
public JMSCorreletionRouter(String actionName, List<KeyValuePair> properties)
throws ConfigurationException
{
super( actionName, properties );
}
@Override
protected void setJMSProperties( Message jmsMessage, org.jboss.soa.esb.message.Message
esbMsg ) throws JMSException
{
String messageId = (String) esbMsg.getBody().get( "MessageId" );
jmsMessage.setJMSCorrelationID( messageId );
}
}
Any chance I would be allowed to sneek this in? :)
Refactory JMSRouter to simplfy setting properties on JMSMessage from
ESB Message object
---------------------------------------------------------------------------------------
Key: JBESB-652
URL:
http://jira.jboss.com/jira/browse/JBESB-652
Project: JBoss ESB
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Daniel Bevenius
Assigned To: Mark Little
Priority: Minor
The use case for this is that we need to set the correlation id of the JMSMessage before
it is sent by the JMSRouter.
We have previously subclassed JMSRouter but this was not the best solution as we needed
to override the route method and duplicate most of the code.
I would be nice to have a method that would be called from the route method that looked
something like this:
setJMSProperties ( jmsMessage, esbMsg );
The default implementation could do nothing but would let subclasses only override this
method.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira