activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: send(topic, msg)
Date Sat, 14 Oct 2006 13:30:53 GMT
To create a generic publisher - you should create it with a null  
destination (this is a JMS spec thing)
e.g.

TopicPublisher publisher = session.createPublisher(null);
publisher.publish(topic,msg);

cheers,

Rob
On 14 Oct 2006, at 13:02, Andy Czerwonka wrote:

> Should I be creating a new publisher for every send like this?  Or  
> should I
> be using the send(topic, msg) method?  If the latter, then how do I  
> create a
> generic publisher?  From what I can see, I can't create a publisher  
> without
> a Topic.  Help.
>
> Topic topic = getDestination(msg);
>
> TopicPublisher publisher = createPublisher(topic);
>
> TextMessage message = _topicSession.createTextMessage(msg);
>
> publisher.send(message);
>
>
>
>


Mime
View raw message