activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "raj.fusion" <rajarshi.bis...@fusionsystems.org>
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
class.

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();
        connection.start();
        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,
            Session.AUTO_ACKNOWLEDGE);
            
              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!
        producer.send(message);

        System.out.println(" ....  ");
        System.out.println("Sent message '" + message.getText() + "'");
System.out.println(" Before connection id closed  ");
        connection.close();
        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: http://activemq.2283324.n4.nabble.com/Can-t-connect-from-Oracle-11g-to-the-active-MQ-broker-via-a-Active-MQ-producer-class-tp2716550p2716565.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message