JMS messages of any standard types cannot be received from SwitchYard JMS reference binding in FSW 6
Issue
- I have a SwitchYard application that has a Camel service route and a JMS reference binding to route messages to a target queue which I have configured in MDB.
- The Camel route
route.xmlis defined as follows:
<route>
<from uri="switchyard://CamelFTPService"/>
<log message="CamelFTPService - message received: ${body}"/>
<bean ref="AuditLoggerAction" method="process"/>
<to uri="switchyard://JMSRemoteService"/>
</route>
- And the
AuditLoggerActionbean is defined as follows:
@Named
public class AuditLoggerAction {
...
public Message process(Message message) throws Exception {
System.out.println("File name is " + message.getHeader("CamelFileName"));
System.out.println("Body: " + ((String)message.getBody(String.class)).trim());
return message;
}
- However, I cannot get messages of type
TextMessageorObjectMessage, butorg.hornetq.jms.client.HornetQMessagein the target MDB. And I cannot get correct data content fromHornetQMessagemessage. - I also noticed the following warning message in the server log:
15:57:03,220 WARN [org.apache.camel.component.jms.JmsBinding] (Camel (camel-4) thread #7 [...]) Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.switchyard.common.camel.SwitchYardMessage. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint.
- How can I get
TextMessageorObjectMessagein MDB? How should I sendTextMessageorObjectMessagefrom SwitchYard to MDB?
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
