the Universal Messaging Developer Guide, in the chapter JMS Message / Event Mapping, describes how to interact with UM via the JMS API and vice versa.
However, I can’t figure out how to publish a nProtobufEvent via the JMS API. My goal is to publish an event from a Java client so that the event can be consumed by the Integration Server.
If I use the native UM API and create (and send) a nProtobufEvent everything works as desired. But I don’t understand how to accomplish this via JMS.
I have a protobuf object that I can convert to bytes; I have a JMS connection. And now what?
If I send the message as a JMS BytesMessage it does not get consumed correctly by the Integration Server.
What I’ve found out so far is that if I publish a message in Integration Server and receive it in the Java client via JMS, I get it as a BytesMessage (with a UM specific implementing class). Within that object, the field evt is set to an instance of the class nProtobufEvent.
But how can I do the same if I need to send a message with the JMS API?
It should be doable… after all the protobuf event is just a byte message with some specific type according to the description here - com.pcbsys.nirvana.client.nProtobufEvent Class Reference. I guess this is what IS does anyway. I suspect it would involve either some cryptic attribute, or manipulating implementation-specific message fields, or some similar forbidden voodoo magic. I’ll see if I can dig something out, but I would not recommend going that way unless you see no other option, since your code will lose on portability.
I’m sure there’s a good reason but I’ll ask anyway - if you are sending JMS, can’t you consume it with an IS JMS trigger?
The reason is that I want to interact with an existing IS application without modifying it a bit.
That would be cool!
I already tried to set all the fields I can to make the message I send look similar to the one I see when a message is received, but apparently I missed something because IS trigger did not fire.
I think it is the other way around: a byte message is passed as a special kind of event. After all, UM only knows events. IS sends a nProtobufEvent. If I do this, everything works. But this is the native API, not JMS.
Any news on this? I was very happy that I could receive messages via JMS and thus use all of the support by the Spring Framework. It would be pity if I’d need to use the native API for sending (and thus have no Spring support).