How to send a nProtobufEvent via the JMS API?

Hello,

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.

I’d be very thankful for any help!

1 Like

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?

Could any expert chime in? Or is it something nobody’s done until now? Is it at all a possible usage of the JMS provider (as a sender)?

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?

Cheers,
Stefan

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).

Thank you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.