Sorry the $subject should be as follows
Amqp client not connecting to activemq server.


On Fri, Oct 17, 2014 at 2:31 PM, Prasanna Dangalla <[email protected]>
wrote:

> Hi,
>
> I'm trying connect from a amqp client to a aqtivemq server with default
> settings to test cache Invalidation in greg. It always gives the error
> message saying connection refused, I wrote a sample client using the
> rabbitmq client library. It to doesn't work with activemq server too. But
> it works in AmalG's lap. Both laps having the same ubuntu versions,
> activemq server versions and rabbitmq client versions. Then I tried it with
> a rabbitmq server instead of a activemq server and it works fine. I wonder
> whether activemq needs a linux library to communicate.
>
> Activemq server versions used which does not connects: 5.4.2 / 5.10.0
> Rabitmq version used: 3.3.5
>
> rabitmq sample client code
>
> import com.rabbitmq.client.ConnectionFactory;
> import com.rabbitmq.client.Connection;
> import com.rabbitmq.client.Channel;
>
> public class Cache {
>     private final static String QUEUE_NAME = "hello";
>
>     public static void main(String[] argv)
>             throws java.io.IOException {
>
>         //creating the connection factory
>         ConnectionFactory factory = new ConnectionFactory();
>         factory.setHost("localhost");
>
>         //Creating a connection to the server
>         Connection connection = factory.newConnection();
>         Channel channel = connection.createChannel();
>
>         //declaring a queuw
>         channel.queueDeclare(QUEUE_NAME, false, false, false, null);
>         String message = "Hello World!";
>
>         //publishing the queue the queue
>         channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
>         System.out.println(" [x] Sent '" + message + "'");
>
>         //closing the connection
>         channel.close();
>         connection.close();
>     }
> }
>
>
> Fails in the following line of code
>        //Creating a connection to the server
>         Connection connection = factory.newConnection();
>
> Thanks
>
> Prasanna Dangalla
> Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
> cell: +94 777 55 80 30 | +94 718 11 27 51
> twitter: @prasa77
>



-- 
Prasanna Dangalla
Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware

cell: +94 777 55 80 30 | +94 718 11 27 51
twitter: @prasa77
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to