Description

Identifies the originator of an incoming message.

Category

Event Gateway Development

Syntax

void setOriginatorID(String originatorID)

See also

getOriginatorIDCFML CFEvent structureCFEvent class in Developing ColdFusion Applications

Parameters

Parameter

Description

originatorID

The gateway or protocol-specific ID of the message originator.

Example

The following code shows the routine from the example JMS gateway that handles incoming messages. It sets the originator ID to the name of the JMS topic that the gateway handles:

public void handleMessage(String msg, String topicName, String msgID) {
coldfusion.eventgateway.Logger log = getGatewayServices().getLogger();
Map data = new HashMap();
CFEvent cfMsg = new CFEvent(getGatewayID());
data.put("msg", msg);
data.put("id", msgID);
cfMsg.setData(data);
cfMsg.setOriginatorID(topicName);
cfMsg.setGatewayType("JMS");
if (sendMessage(cfMsg)) {
log.info("Added message '" + msgID + "' to queue.");
} else {
log.error("Failed to add message '" + msgID + "' to queue.");
}
}

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy