aspose file tools*
The moose likes XML and Related Technologies and the fly likes Publishing contents of an XML document to a topic in JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Publishing contents of an XML document to a topic in JMS" Watch "Publishing contents of an XML document to a topic in JMS" New topic
Author

Publishing contents of an XML document to a topic in JMS

Arpan Joshi
Greenhorn

Joined: Oct 06, 2005
Posts: 1
Hi all,

I am trying to develop a JMS based messaging system using pub-sub model.
Before my publisher publishes messages it has to parse an XML configuration file which will be as follows:

<consumerConfiguration>
<name>BSA-TimeCard</name>
<topic>Some-Topic</topic>
<JMSProvider>100.100.2.2</JMSProvider>
<destination>BSA.OUTGOING</destination>
<body>
CDATA
</body>
</consumerConfiguration>

Values for all of these elements are required and based on the value of topic element I want to select the topic to publish this message to. In this case the value of topic element in the configuration file is timecard so my topic for this message has to be timecard. Now, the elements till the body elements are all part of my header and I don't want to send the header as part of my message. Once the header information(all header elements are present) is verified (if not I want to throw an exception),
I want to send the CDATA(if not empty) which is the message body as part of my JMS message.

Please help me in solving this problem. I am ok in validating the XML file before send it as a message but verifying the header information and choosing the topic on the basis of the topic element is what I need help with.

Hope this is clear enough.

Thanks

arpan
RNivas
Greenhorn

Joined: Aug 20, 2003
Posts: 8
I think ebml/ebxml can help you out for this
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
choosing the topic on the basis of the topic element is what I need help with.

Extracting the text content of an element is a basic XML processing task. You will find it covered extensively in the many XML tutorials to be found on the net.
You also need to become familiar with the API that describes the structure of XML documents to be found in the org.w3c.dom package in your JavaDocs.
Start with the org.w3c.dom.Node interface.

RNivas - you need to go make your name compatible with the Javaranch naming policy before a sheriff gets on your case.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Publishing contents of an XML document to a topic in JMS