JMS routing

Hi all,

I have a case where I expose an http REST interface and where I put the incoming payload onto a jms queue using the JMS/AMQP routing in policies.

I also need to set JMSType dynamically but how I ever try I cannot seem to be able to set any property or header. I have tried:

  • the Set JMS/AMQP Property in Routing (Key: JMSType, value: tried a lot of combinations)
  • the request transformation of Header (Variable: ${jms.headers.JMSType}, value: (tried “TEST”, TEST and TEST_${sys:resource_path})

The payload is put just fine on the queue but none of the property or Header values I’ve tried setting myself is passed.

Anyone have an idea what could be the issue?

Thanks!

Nils-Göran Bakkerud

Hi Nils-Göran Bakkerud,

There is a bug in “JMS/AMQP Properties”. Please use “Custom HTTP Header” for passing headers. Those headers will put in the Queue as properties.

Thanks,
Clench

Hi Clench and thank you for your answer,

I tested this approach now and I can create a property that is set with a value. That’s good.

However I need to set the JMSType (due to processing setup) and this is, when reading from the JMS UM queue, placed under JMSMessage/header. I am not able to set this as a property, then nothing happens. And no value is passed to the header JMSType.

BR
Nils-Göran

Hi Nils-Göran,

I didn’t notice at first that you are setting “JMSType” header.

Actually some of the standard JMS properties/headers are not allowed to set. This details are provided in the API Gateway user guide. Please refer Policies -> Routing -> JMS/AMQP Policies -> JMS/AMQP Properties -> Predefined JMS Properties in the guide.

Thanks,
Clench

Hi,

Yes, but JMSType should be ok to use according to the documentation.
At least that is how I interpret the information. See attached screenshot.

Hi,

We analyzing whether that is a bug or expected behavior.

Meanwhile we have tried to set JMSType using “Custom HTTP Header” policy and went through. We have tested with ActiveMQ. Screenshots attached.

Thanks,
Clench


Hi,
Thanks for your efforts.

Setting properties with other key names than JMSType works with JMS as well when using Custom HTTP Header.
But I see your key is named Type and not JMSType, which does not seem to work for JMS.

We use a workaround, calling an IS-service which puts the message on the queue with modified JMSType.

Unfortunately we need this naming of the key to be JMSType.

Br
Nils-Göran


Hi,

We too set JMSType using Custom HTTP Header. It went into the queue successfully. But only on the ActiveMQ admin page it is displayed as Type for that message. Not sure with UM.

Thanks,
Clench