Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6820

Improve SJMS handling of exchange body data types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.1
    • 2.12.4, 2.13.1
    • camel-sjms
    • None
    • Novice

    Description

      With a route as below
      from("file:fname.txt").to("sjms:queue:qname")
      we get an error because the Jms message type is of type Message.
      The issue seems to be in JmsMessageHelper.discoverMessageTypeFromPayload.
      GenericFile is the payload object which is not serializable itself. sjms has this line:
      else if (Serializable.class.isInstance(payload)) {
      answer = JmsMessageType.Object;
      JMS component has this code in the JmsBinding class
      case Object:
      ObjectMessage message = session.createObjectMessage();
      if (body != null) {
      try {
      Serializable payload = context.getTypeConverter().mandatoryConvertTo(Serializable.class, exchange, body);
      message.setObject(payload);

      Attachments

        Activity

          People

            sully6768 Scott England-Sullivan
            nigell Nigel Longton
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: