users@glassfish.java.net

Re: GF v2 b36 + ActiveMQ 4.1

From: Daniel Cavalcanti <dhcavalcanti_at_gmail.com>
Date: Tue, 20 Feb 2007 17:10:02 -0500

One of many possible points that I see is that you need to start the
connection so that the mssages get delivered, i.e. connection.start();
probably before you created the producer.

On 2/20/07, David Harrigan <dharrigan_at_gmail.com> wrote:
>
>
> Hi,
>
> I'm trying out the latest (and greatest) GF with ActiveMQ 4.1. I've
> downloaded the Resource Adapter for ActiveMQ which conforms to the JCA 1.5
> spec.
>
> * Deployed the RA in GF - no problem.
> * Created a Connector Connection Pool called jms/connectionPool
> * Created a Connector Resource called jms/connectionFactory configured to
> use jms/connectionPool
> * Created Admin Object Resource called jms/testQueue with name of
> testQueue
> * Under Physical Destinations in Configuration -> Java Message Service
> created a testQueue
>
> My client (producer) looks like this (stripped of ilrelevant code):
>
> @Resource(mappedName="jms/connectionFactory")
> private static ConnectionFactory connectionFactory;
>
> @Resource(mappedName="jms/testQueue")
> private static Queue queue;
>
> private void doIt() throws Exception {
> final Connection connection = connectionFactory.createConnection
> ();
> final Session session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
> final MessageProducer messageProducer =
> session.createProducer(queue);
> TextMessage textMessage = session.createTextMessage("Hello World!
> ");
> messageProducer.send(textMessage);
> connection.close();
> }
>
> My consumer (my Message Driven Bean) looks like this:
>
> @MessageDriven(mappedName = "jms/testQueue")
> public class MessageBean {
>
> @Resource MessageDrivenContext messageDrivenContext;
>
> public void onMessage(final Message message) {
> final TextMessage textMessage = (TextMessage)message;
> try {
> System.out.println("Received this message : " +
> textMessage.getText());
> } catch (final JMSException e) {
> e.printStackTrace();
> }
> }
> }
>
> Now, her e comes the interesting part:
>
> When I execute my App using this:
>
> ./appclient -client
> /home/david/javastuff/eclipse-3.2.1/workspace/jee5/dist/jmsclient.jar
>
> I get output in the server.log
>
> BUT and this is a big BUT!!
>
> I haven't started ActiveMQ on my system! It's not even running anywhere!
>
> I'm at a loss as why this is happening (I've deleted (I think - looks like
> that in the web console)) any reference to jmsra.
>
>
> Anyone with any idea?
>
>
> -=david=-
> --
> View this message in context:
> http://www.nabble.com/GF-v2-b36-%2B-ActiveMQ-4.1-tf3263484.html#a9071269
> Sent from the java.net - glassfish users mailing list archive at
> Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>