JMS messages of any standard types cannot be received from SwitchYard JMS reference binding in FSW 6

Solution Verified - Updated -

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.xml is 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 AuditLoggerAction bean 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 TextMessage or ObjectMessage, but org.hornetq.jms.client.HornetQMessage in the target MDB. And I cannot get correct data content from HornetQMessage message.
  • 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 TextMessage or ObjectMessage in MDB? How should I send TextMessage or ObjectMessage from 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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content