activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: transport connector problem
Date Tue, 27 Jun 2006 09:51:43 GMT
Sounds like you have some dodgy network issues. e.g. if you get
java.net.NoRouteToHostException then something strange is going on.

Try run things using tcp on the local host to get yourself familiar
with ActiveMQ and your JMS code. Once you can run things in multiple
processes on the same box using tcp://localhost:61616 - moving to
multiple hosts requires either DNS to be setup and working properly -
or for your IP addresses to be assigned to boxes correctly and for
there to be routes from box to box; if you are having trouble using
host names / IP addresses to connect to other boxes, contact your
network sysadmin to setup TCP/DNS correctly.

On 6/27/06, kirkal <bikirme@gmail.com> wrote:
>
> hi
>
>  thanks for the reply....
>
>  i think its part of a larger problem - i have AMQ 4.0 RC2 up and running on
> a system(remotehost) and am trying to send messages to a topic and receive
> messages from the topic using a simple pub/sub code beofre i proceed to
> anything further. however, the topicconsume code keeps returning a
> "Received:null " as the result. what do i do?  the code fragments are as
> shown below:
>
> TopicPublish.java
>
> Context ctx = new InitialContext();
>                         ActiveMQConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory("tcp://remotehost:61616");
>             Connection connection = connectionFactory.createConnection();
>             connection.start();
>                         TopicSession topicSession = ((TopicConnection)
> connection).createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
> Topic destination = topicSession.createTopic("TEST.FOO");
> TopicPublisher topicPublisher = topicSession.createPublisher(destination);
> System.out.println("Sample application publishing a message to a topic.");
>                         for ( int i=0;i<10;i++)
>                         {
>
>
>                         TextMessage message = topicSession.createTextMessage("Hello world");
>                         message.setJMSDestination(destination);
>                         topicPublisher.publish(message);
>                         topicPublisher.publish(destination,message);
>                         topicPublisher.send(destination,message);
>                         System.out.println(topicPublisher.getDestination());
>                         System.out.println(message);
>                         topicPublisher.publish(destination,message);
> }
>                         // clean up
>                         topicPublisher.close();
>                         topicSession.close();
>                         connection.close();
>
>                 }
>
>
>
>
> TopicConsume.java
>
> Same setup as before
>
> Topic destination = topicSession.createTopic("TEST.FOO");
>
>                         MessageConsumer consumer =
> topicSession.createDurableSubscriber(destination, null);
>
>                         Message message = consumer.receive(1000);
>
>             if (message instanceof TextMessage) {
>                 TextMessage textMessage = (TextMessage) message;
>                 String text = textMessage.getText();
>                 System.out.println("Received: " + text);
>             } else {
>                 System.out.println("Received: " + message);
>             }
>
>
>
>
>   By rights, this is such simple code that it should run with no
> problems......it does not run, at all.
>
>   Eitehr the TopicConsume code crashes saying the host is unreachable or
> Reason: java.net.NoRouteToHostException: No route to host
>
>   I have no clue whaat to do here....even simple code like this seems not to
> work and i seem to find no documentation that helps.
>
>  any help / suggestions would be appreciated.
> --
> View this message in context: http://www.nabble.com/transport-connector-problem-tf1847502.html#a5062872
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message