glassfish
  1. glassfish
  2. GLASSFISH-20998

JMS messages lose message properties when sent via JMSContext. Selector's don't work.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: jms
    • Labels:
      None

      Description

      When sending a message via JMSContext, none of the properties sent on the message arrive at the client, making jms message selectors unusable.

      You can use the same test case as here, https://java.net/jira/browse/GLASSFISH-20973

        Activity

        Hide
        Nigel Deakin added a comment - - edited

        Seems to work for me. Can you please paste the exact code you used to set the property?

        I tried these two variants:

        setting it directly on the Message:

        try (JMSContext context = connectionFactory.createContext()){
           TextMessage textMessage = context.createTextMessage("Hello world");
           textMessage.setStringProperty("MyProperty", "Koala");
           context.createProducer().send(inboundQueue,m);
        }
        

        and setting it via the JMSProducer

        try (JMSContext context = connectionFactory.createContext()){
           context.createProducer().setProperty("MyProperty", "Wombat").send(inboundQueue,"Hello world");
        }
        

        and checked the property was set on the received message using

        String myProp = message.getStringProperty("MyProperty");
        

        and confirmed that the expected property value was set.

        Show
        Nigel Deakin added a comment - - edited Seems to work for me. Can you please paste the exact code you used to set the property? I tried these two variants: setting it directly on the Message : try (JMSContext context = connectionFactory.createContext()){ TextMessage textMessage = context.createTextMessage("Hello world"); textMessage.setStringProperty("MyProperty", "Koala"); context.createProducer().send(inboundQueue,m); } and setting it via the JMSProducer try (JMSContext context = connectionFactory.createContext()){ context.createProducer().setProperty("MyProperty", "Wombat").send(inboundQueue,"Hello world"); } and checked the property was set on the received message using String myProp = message.getStringProperty("MyProperty"); and confirmed that the expected property value was set.

          People

          • Assignee:
            David Zhao
            Reporter:
            pranahata
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: