• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Publishing contents of an XML document to a topic in JMS

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think ebml/ebxml can help you out for this
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic