This content has been marked as final.
Show 2 replies
-
1. Re: How does a REST publisher specify a selector data field?
jbertram Feb 7, 2012 5:14 PM (in response to rodk)There currently is no support for specifying arbitrary message properties on a message published by a REST client.
-
2. Re: How does a REST publisher specify a selector data field?
rodk Feb 14, 2012 2:13 PM (in response to jbertram)It helped knowing that what I was looking for does not exist. Thanks!
The workaround is to create an incoming topic and a JMS bridge between the REST publisher and REST subscribers.
So a setup might look like this:
REST publisher ==> incomingTopic == push ==> JMS bridge (see note 1) == publish ==> notifyTopic == push ==> REST subscriber
note 1: In this code,
- a JMS client receives the message (HornetQ receives it as a ByteMessage... you'll have to convert it to a String to get to the original XML)
- Create an ObjectMessage for the outgoing message. The message body is the original XML string.
- Add properties, as appropriate (e.g., call Message's setStringProperty).
- Per section 9.1 of the "HornetQ REST Interface 2.2.5.Final", set the property as follows: message.setStringProperty(org.hornetq.rest.HttpHeaderProperty.CONTENT_TYPE, "application/xml");
- Publish the outgoing message
- The REST subscribers should receive the messages per the filter settings when they subscribed