You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Elliotte Rusty Harold (JIRA)" <ji...@apache.org> on 2007/08/08 21:05:01 UTC

[jira] Created: (AMQ-1359) ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server

ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server
------------------------------------------------------------------------

                 Key: AMQ-1359
                 URL: https://issues.apache.org/activemq/browse/AMQ-1359
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.0.0
            Reporter: Elliotte Rusty Harold


I have some code that worked fairly well with the release version of ActiveMQ 4.1 using OpenWire. One of my colleagues upgraded the server to the latest snapshot of ActiveMQ 5, and suddenly while I could still write to the queues on that server I could no longer read from them. 

Upgrading my client's jar to 5.0 cured the problem. The client was now able to read from and write to the 5.0 server. However the client and server versions should not need to be in such close sync. 

For example, this simple program to write a couple of messages and then read them back fails until I change the jar archive to match the server's:

import javax.jms.*;
import org.apache.activemq.*;
import org.apache.activemq.command.*;

public class CompletedRead {

   
    private static String url = "tcp://queue.example.com:61616";
    private static String queue = "foo";

        public static void main(String[] args) throws JMSException {
           
            ConnectionFactory out = new ActiveMQConnectionFactory(url);
            Connection connection = out.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer producer = session.createProducer(destination);
            TextMessage message = session.createTextMessage();
            message.setText("118652");
            producer.send(message);
            message.setText("118653");
            producer.send(message);
           
            producer.close();
            session.close();
            connection.close();
           
            receive();
        }

        private static void receive() throws JMSException {
            ConnectionFactory in = new ActiveMQConnectionFactory(url);
            Connection connection = in.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
           
            MessageConsumer consumer = session.createConsumer(destination);
            TextMessage message = (TextMessage) consumer.receive(10000);
            System.out.println(message.getText());
            message = (TextMessage) consumer.receive(10000);
            System.out.println (message.getText());
           
            consumer.close();
            session.close();
            connection.close();
           
        }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1359) ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully updated AMQ-1359:
----------------------------

    Fix Version/s: 5.3.0
                       (was: 5.2.0)

> ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server
> ------------------------------------------------------------------------
>
>                 Key: AMQ-1359
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1359
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Elliotte Rusty Harold
>             Fix For: 5.3.0
>
>
> I have some code that worked fairly well with the release version of ActiveMQ 4.1 using OpenWire. One of my colleagues upgraded the server to the latest snapshot of ActiveMQ 5, and suddenly while I could still write to the queues on that server I could no longer read from them. 
> Upgrading my client's jar to 5.0 cured the problem. The client was now able to read from and write to the 5.0 server. However the client and server versions should not need to be in such close sync. 
> For example, this simple program to write a couple of messages and then read them back fails until I change the jar archive to match the server's:
> import javax.jms.*;
> import org.apache.activemq.*;
> import org.apache.activemq.command.*;
> public class CompletedRead {
>    
>     private static String url = "tcp://queue.example.com:61616";
>     private static String queue = "foo";
>         public static void main(String[] args) throws JMSException {
>            
>             ConnectionFactory out = new ActiveMQConnectionFactory(url);
>             Connection connection = out.createConnection();
>             Destination destination = new ActiveMQQueue( queue );
>             connection.start();            
>             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>             MessageProducer producer = session.createProducer(destination);
>             TextMessage message = session.createTextMessage();
>             message.setText("118652");
>             producer.send(message);
>             message.setText("118653");
>             producer.send(message);
>            
>             producer.close();
>             session.close();
>             connection.close();
>            
>             receive();
>         }
>         private static void receive() throws JMSException {
>             ConnectionFactory in = new ActiveMQConnectionFactory(url);
>             Connection connection = in.createConnection();
>             Destination destination = new ActiveMQQueue( queue );
>             connection.start();            
>             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>            
>             MessageConsumer consumer = session.createConsumer(destination);
>             TextMessage message = (TextMessage) consumer.receive(10000);
>             System.out.println(message.getText());
>             message = (TextMessage) consumer.receive(10000);
>             System.out.println (message.getText());
>            
>             consumer.close();
>             session.close();
>             connection.close();
>            
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-1359) ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server

Posted by "Bruce Snyder (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Snyder updated AMQ-1359:
------------------------------

    Description: 
I have some code that worked fairly well with the release version of ActiveMQ 4.1 using OpenWire. One of my colleagues upgraded the server to the latest snapshot of ActiveMQ 5, and suddenly while I could still write to the queues on that server I could no longer read from them. 

Upgrading my client's jar to 5.0 cured the problem. The client was now able to read from and write to the 5.0 server. However the client and server versions should not need to be in such close sync. 

For example, this simple program to write a couple of messages and then read them back fails until I change the jar archive to match the server's:

{code}
import javax.jms.*;
import org.apache.activemq.*;
import org.apache.activemq.command.*;

public class CompletedRead {

   
    private static String url = "tcp://queue.example.com:61616";
    private static String queue = "foo";

        public static void main(String[] args) throws JMSException {
           
            ConnectionFactory out = new ActiveMQConnectionFactory(url);
            Connection connection = out.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer producer = session.createProducer(destination);
            TextMessage message = session.createTextMessage();
            message.setText("118652");
            producer.send(message);
            message.setText("118653");
            producer.send(message);
           
            producer.close();
            session.close();
            connection.close();
           
            receive();
        }

        private static void receive() throws JMSException {
            ConnectionFactory in = new ActiveMQConnectionFactory(url);
            Connection connection = in.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
           
            MessageConsumer consumer = session.createConsumer(destination);
            TextMessage message = (TextMessage) consumer.receive(10000);
            System.out.println(message.getText());
            message = (TextMessage) consumer.receive(10000);
            System.out.println (message.getText());
           
            consumer.close();
            session.close();
            connection.close();
           
        }
{code}

  was:
I have some code that worked fairly well with the release version of ActiveMQ 4.1 using OpenWire. One of my colleagues upgraded the server to the latest snapshot of ActiveMQ 5, and suddenly while I could still write to the queues on that server I could no longer read from them. 

Upgrading my client's jar to 5.0 cured the problem. The client was now able to read from and write to the 5.0 server. However the client and server versions should not need to be in such close sync. 

For example, this simple program to write a couple of messages and then read them back fails until I change the jar archive to match the server's:

import javax.jms.*;
import org.apache.activemq.*;
import org.apache.activemq.command.*;

public class CompletedRead {

   
    private static String url = "tcp://queue.example.com:61616";
    private static String queue = "foo";

        public static void main(String[] args) throws JMSException {
           
            ConnectionFactory out = new ActiveMQConnectionFactory(url);
            Connection connection = out.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer producer = session.createProducer(destination);
            TextMessage message = session.createTextMessage();
            message.setText("118652");
            producer.send(message);
            message.setText("118653");
            producer.send(message);
           
            producer.close();
            session.close();
            connection.close();
           
            receive();
        }

        private static void receive() throws JMSException {
            ConnectionFactory in = new ActiveMQConnectionFactory(url);
            Connection connection = in.createConnection();
            Destination destination = new ActiveMQQueue( queue );
            connection.start();            
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
           
            MessageConsumer consumer = session.createConsumer(destination);
            TextMessage message = (TextMessage) consumer.receive(10000);
            System.out.println(message.getText());
            message = (TextMessage) consumer.receive(10000);
            System.out.println (message.getText());
           
            consumer.close();
            session.close();
            connection.close();
           
        }


> ActiveMQ 4.1.1 client can write to but not read from ActiveMQ 5.0 server
> ------------------------------------------------------------------------
>
>                 Key: AMQ-1359
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1359
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Elliotte Rusty Harold
>             Fix For: AGING_TO_DIE
>
>
> I have some code that worked fairly well with the release version of ActiveMQ 4.1 using OpenWire. One of my colleagues upgraded the server to the latest snapshot of ActiveMQ 5, and suddenly while I could still write to the queues on that server I could no longer read from them. 
> Upgrading my client's jar to 5.0 cured the problem. The client was now able to read from and write to the 5.0 server. However the client and server versions should not need to be in such close sync. 
> For example, this simple program to write a couple of messages and then read them back fails until I change the jar archive to match the server's:
> {code}
> import javax.jms.*;
> import org.apache.activemq.*;
> import org.apache.activemq.command.*;
> public class CompletedRead {
>    
>     private static String url = "tcp://queue.example.com:61616";
>     private static String queue = "foo";
>         public static void main(String[] args) throws JMSException {
>            
>             ConnectionFactory out = new ActiveMQConnectionFactory(url);
>             Connection connection = out.createConnection();
>             Destination destination = new ActiveMQQueue( queue );
>             connection.start();            
>             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>             MessageProducer producer = session.createProducer(destination);
>             TextMessage message = session.createTextMessage();
>             message.setText("118652");
>             producer.send(message);
>             message.setText("118653");
>             producer.send(message);
>            
>             producer.close();
>             session.close();
>             connection.close();
>            
>             receive();
>         }
>         private static void receive() throws JMSException {
>             ConnectionFactory in = new ActiveMQConnectionFactory(url);
>             Connection connection = in.createConnection();
>             Destination destination = new ActiveMQQueue( queue );
>             connection.start();            
>             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>            
>             MessageConsumer consumer = session.createConsumer(destination);
>             TextMessage message = (TextMessage) consumer.receive(10000);
>             System.out.println(message.getText());
>             message = (TextMessage) consumer.receive(10000);
>             System.out.println (message.getText());
>            
>             consumer.close();
>             session.close();
>             connection.close();
>            
>         }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.