Skip to main content

Messaging

Within the PEX framework, most messages sent between business hosts are objects instantiated from a subclasses of com.intersystems.enslib.pex.Message in Java and InterSystems.EnsLib.PEX.Message in .NET. You simply add properties to your subclass, and then pass instantiated objects of the subclass using methods like SendRequestAsync() and SendRequestSync(). Within InterSystems IRIS, the Java or .NET message object corresponds to an object of class EnsLib.PEX.Message, which makes the message persistent and dynamic. By manipulating the object of type EnsLib.PEX.Message, you can reference any property in the Java or .NET object. Internally, the Java or .NET object is represented as JSON as it passes between business hosts, so viewing the messages in the Management Portal are displayed in JSON format.

Though you can use other message objects, they must still be persistent if they are being passed between business hosts. To pass an object to a built-in ObjectScript component, you use the type IRISObject and map it to the persistent object expected by that component. For example, if you are sending a message to the EnsLib.PubSub.PubSubOperation, you would map the IRISObject to EnsLib.PubSub.Request. Trying to pass a non-persistent object as a message between business hosts results in a runtime error.

Objects sent from an inbound adapter to a business service are arbitrary and do not need to be persistent.

Feedback