doubts jms

Im using JMS and I ve got several doubts.

The first one, how can i create a topic in the code without declaring in SUn ONE Application Server 7.0? That is I d like to create a method that allow to create topics to publish message and i would like to know how to do that, if it is possible.

The second one is: I m using the patron ServiceActivator to create an interface MDB-EJB and I would like to know what can I do to generate an answer. Is it possible sending a message back?

Thank in advance

Charly

[540 byte] By [charly10000] at [2007-11-25 17:20:02]
# 1

Charly,

I'm not sure exactly what you are asking, but I'll take a stab at it

anyway.

In JSMQ a "destination" consists of two parts. One is the handle the

client uses to refer to the destination, the other is the physical

destination on imqbrokerd (MQ's server component) that actually holds

the messages.

The destination handle is either an administered object that you

look up in JNDI, or a Destination object you create programatically

using a vendor specific name (via Session.createTopic() for example).

The physical destination is created on imqbrokerd using administrative

tools.

Currently there is no administrative API to create a physical destination.

JSMQ does support destinations that are autocreated when a producer

or consumer attaches to the destination. The attributes for those

destinations can be controlled using the imq.autocreate.* imqbrokerd

properties (see the MQ administration guide for more information).

Autocreation is usually not recommended for deployment because you

have less control over broker resources when they are used.

Also, depending on what you are doing, using a temporary destination

(i.e. Session.createTemporaryQueue()) and the JMSReplyTo header may be

appropriate. Temporary destinations are created dynamically and have

the same lifespan as the connection.

As to your ServiceActivator question, I think you are asking "How do I send

a message from an MDB?". The following technical article may help:

http://developers.sun.com/prodtech/appserver/reference/techart/tip1_june_2003.h tml

And as I mentioned above you may want to use JMSReplyTo and a

temporary destination to coordinate the response.

Joe

jfdp at 2007-7-3 12:50:35 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...