activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "raj.fusion" <>
Subject Re: Can't connect from Oracle 11g to the active MQ broker via a Active MQ producer class
Date Tue, 28 Sep 2010 03:31:31 GMT

After an insert the trigger is fired , and a procedure calls this producer

The code is like this,

    public static void mainS(String args) throws JMSException {
        // Getting JMS connection from the server and starting it
        ConnectionFactory connectionFactory =
            new ActiveMQConnectionFactory(url);
        Connection connection = connectionFactory.createConnection();
        System.out.println("Connection started .... ");
        // JMS messages are sent and received using a Session. We will
        // create here a non-transactional session object. If you want
        // to use transactions you should set the first parameter to 'true'
        Session session = connection.createSession(false,
              System.out.println("Session AUTO_ACKNOWLEDGED .... ");

        // Destination represents here our queue 'TESTQUEUE' on the
        // JMS server. You don't have to do anything special on the
        // server to create it, it will be created automatically.
        Destination destination = session.createQueue(subject);
                      System.out.println("session.createQueue  ");

        // MessageProducer is used for sending messages (as opposed
        // to MessageConsumer which is used for receiving them)
        MessageProducer producer = session.createProducer(destination);
  System.out.println("MessageProducer created  ");
        // We will send a small text message saying 'Hello' in Japanese
        TextMessage message = session.createTextMessage("Konnichiwa");
  System.out.println("TextMessage created ....  ");
        // Here we are sending the message!

        System.out.println(" ....  ");
        System.out.println("Sent message '" + message.getText() + "'");
System.out.println(" Before connection id closed  ");
        System.out.println(" After connection is closed  ");

Please, see the highlighted thread text  producer.send  , we are not able to
get the control back after this line.

Thanks in advance.

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message