send JMS message to IS from Java

Hi,

Has anyone tried to send XML message from java client to IS destination via provided JMS functions,not JMS Adapter ?? JMSMessage’s body is alway missing when the JMSTrigger picks up the message from the destination ??

I am not getting JMSMessage.body when I send TextMessage from Java client. I am testing with Message and TextMessage as shown below

As you can see the java client knows about the Broker, connection factory and destination… However, when the JMS Trigger pick up the destination, it calls IS flow service, the IS flow service somehow has empty body ??? What have I done wrong.:confused:

Broker::JmsNaming::WmJmsNamingContext
{java.naming.provider.url=wmjmsnaming://Broker #1@syd3kvm239:6849, java.naming.factory.initial=com.webmethods.jms.naming.WmJmsNamingCtxFactory}

MyTopicTwoLookup: com.webmethods.jms.impl.WmTopicImpl
MyTopicOneLookup: com.webmethods.jms.impl.WmTopicImpl
zzCharsConnectionFactory: com.webmethods.jms.impl.WmTopicConnectionFactoryImpl
Sending message: com.webmethods.jms.impl.WmTextMessageImpl[
headers={
JMSCorrelationID=myCorrelationID-222
JMSDeliveryMode=Persistent
JMSDestination=null
JMSExpiration=0
JMSMessageID=null
JMSPriority=4
JMSRedelivered=false
JMSReplyTo=null
JMSTimestamp=0
JMSType=null
}
properties={
data=<num_of_room>0</num_of_room>123AAAAAAAgent-from Java script
price=18
agent=AAAAgent
suburb=AAA
num_of_room=2
}
body={
aaa11111111
}
]

Here is the setting in WM
Provider

Provider Name:zzCharsWMProvider
Initial Context Factory:com.webmethods.jms.naming.WmJmsNamingCtxFactory
Provider URL:wmjmsnaming://Broker #1@syd3kvm239:6849
Security Principal:

Security Credential:
Other Properties: com.webmethods.jms.naming.clientgroup=admin

Provider JARs:C:\webMethods7\MWS\lib\ext\wmjmsnaming.jar;
Number of Connection Factories:1
Number of Destinations:2

ConnectionFactory

Lookup Name:zzCharsConnectionFactory
Provider:zzCharsWMProvider
Connection Factory Type:TopicConnectionFactory
Connection Factory Client ID:Broker Server:syd3kvm239:6849
Broker:Broker #1
Client Group:JMSClient
Use SSL Encryption:No
SSL Keystore:SSL Keystore Type:

SSL Truststore:

SSL Truststore Type:

Marshal In Class Name:

Marshal Out Class Name:

Destination

Lookup Name:MyTopicTwoLookup
Provider:zzCharsWMProvider
Destination Name:MyTopicTwo
Destination Type:Topic
Shared state:false
Shared State Ordering:Publisher
Document Type Name:MyTopicTwo

My java code refers to the lookup names,
String wmConnectionFactory = “zzCharsConnectionFactory”;
String destNameOne = “MyTopicOneLookup”;
String destNameTwo = “MyTopicTwoLookup”;

connection = connectionFactory.createConnection();

Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(destOne);
TextMessage message1 = session.createTextMessage();
message1.setText("")

producer.send(message1);

Data in pipeline…

<?xml version="1.0" encoding="UTF-8"?> zzChar1.Exerc.ExercJMS.consumer:conJMS2_1 1 2 com.webmethods.jms.impl.WmTopicImpl[name=MyTopicTwo eventType=MyTopicTwo sharedState=false sharedStateOrdering=none deadLetterOnly=false localOnly=false priorityOrdering=true readOnly=false] 0 ID:2959947-39-82-3 4 false null 1285999554996

As you can see, I expect to get Message in the body ???

Hi all,

Got this to work, refer how to JMS-Broker mapping, p223 in 8-0-SP1_Broker_Messaging_Programmers_Guide.pdf
When non-JMS events are received, they are mapped to a JMS Message type according to
the following algorithm:
-If there are no fields, the message type is Message.
-If there is a single string field, the message type is TextMessage.
-If there is a single byte sequence field named object, the message type is ObjectMessage.

  • If there is a single byte sequence field, the message type is BytesMessage.
    If there are no structs or sequences, the message type is MapMessage.
  • If there are no structs or sequences, then the entire event is encapsulated in a BytesMessage. The receiver can use the Broker Java API to decode the contents of the BytesMessage by creating an instance of BrokerEvent using the contents of BytesMessage. For more information, see BrokerEvent.fromBinData in the Javadoc.
    With this, I need to send JMSMessage/body/string must be used, NOT JMSMessage/body/data or JMSMessage/body/message. Otherwise, WM will think it is IData object that is passed in for inbound java client msg.

Sending outbound msg is the same… must use JMSMessage/body/string, NOT JMSMessage/body/data or JMSMessage/body/message. Otherwise, WM will send IData object to java client msg. The java will map this to BytesMessage!!!, not TextMessage

Hi, I have provided How-to document on JMS topic. Hoping it will be useful for everyone.