I just committed some stuff to make it easy to send JMS messages using Seam (EJB makes it nice and easy to receive messages, but sending is still a pain).
Check out the massively simplified chatroom example:
@Stateful
@Name("chatroomAction")
@Scope(CONVERSATION)
public class ChatRoomAction implements ChatRoomActionWebRemote
{
@In(create=true)
private transient TopicPublisher topicPublisher;
@In(create=true)
private transient TopicSession topicSession;
...
...
private void publish(ChatroomEvent message)
{
try
{
topicPublisher.publish( topicSession.createObjectMessage(message) );
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
}
}