|
In JMS, you can post a message to a queue using ObjectMessage, MapMessage, TextMessage , StreamMessage, or ByteMessage. At first glance, ObjectMessage and MapMessage look like the most likely candidates that the JMS adapter would use to send messages. But a closer look suggests that the ObjectMessage format can go out of reckoning because the developer needs to implement a serializable class, which would complicate things for the MDB developer. Also notice that the definition of each operation is similar to an individual method call.
So you might think the better choice would be MapMessage, because you can make the parameter name into a key and you can make the value for the parameter be the value for the key. But, TextMessageis actually the better choice, because you can use a self-descriptiveXML format, which defines everything about the contents of the message,as shown in Listing 7.
Listing 7. XML format of text message
<StepElement LaunchedBy="Administrator"
LaunchedOn="20090324T153400Z"
ReceivedOn="20090324T153401Z"
Description="" WOBName="*" WOBNumber="582B46B0D1203D4F981F4F2A707963FF"
WorkflowName="CruiseBooking"
WorkflowNumber="582B46B0D1203D4F981F4F2A707963FF"
WorkClassName="CruiseBooking"
Tag="*"
RosterName="DefaultRoster"
QueueName="JMSQueue"
CurrentQueueName="JMSQueue"
Operati
CurrentMapName="Workflow"
Excepti
Excepti
IsTracker="false"
Overdue="NotOverdue"
CanReassign="false"
CanViewStatus="false"
CanViewHistory="false"
CanReturnToSource="false">
<Originator>
<Value DistinguishedName="CN=Administrator,CN=Users,DC=ibm,DC=idmdev,DC=com"
DisplayName="Administrator"
GUID="S-1-5-21-3351868238-2367661336-251463525-500"
DomainName="dc=ibm,dc=idmdev,dc=com"
IsGroup="false">administrator</Value>
</Originator>
<Responses/>
<Parameters>
<Parameter Name="cruiseID" AuthoredName="cruiseID" Description="" Type="int"
IsSystemParameter="false" Mode="in" IsArray="false">
<Values>
<Value>51</Value>
</Values>
</Parameter>
<Parameter Name="orderID" AuthoredName="orderID" Description=""
Type="int" IsSystemParameter="false" Mode="in" IsArray="false">
<Values>
<Value>52</Value>
</Values>
</Parameter>
<Parameter Name="passengerName" AuthoredName="passengerName" Description=""
Type="string" IsSystemParameter="false" Mode="in" IsArray="false">
<Values>
<Value>hellodude</Value>
</Values>
</Parameter>
<Parameter Name="passengerID" AuthoredName="passengerID" Description=""
Type="int" IsSystemParameter="false" Mode="in" IsArray="false">
<Values>
<Value>53</Value>
</Values>
</Parameter>
</Parameters>
</StepElement> |
|