[rabbitmq-discuss] Java Client not able to create channel

Adam Kaminiecki adamka at dgt.com.pl
Wed Nov 24 10:56:40 GMT 2010


Hi,

If you can install server version 2.1.1

First You have to create connectionfactory

var conFactory = new ConnectionFactory { serwerAddress };
var conn = conFactory.CreateConnection();

then use:

channel = conn.CreateModel();


Its example from C# but I believe that is shoud be similar in Java.
I hope it will help.

Regards,
Adam



W dniu 2010-11-24 11:31, Abhishek Kona pisze:
> Hi
>
> I am using the Java API 2.1.0 with RabbitMQ 2.1.0
>
> My code is :
>  if ((this.channel == null) || this.channel.isOpen() == false)
>         {
>             try
>             {
>
>                 this.channel = connection.createChannel();
>
>             }
>             catch (final IOException e)
>             {
>                 logger.error("While refreshing channel" + e);
>
>             }
>        }
>
>
> There is a single instance of this class which has a connection object 
> which is created only once.
> A channel is created before every operation on RabbitMQ.
> I have observed that after some time the program waits at 
> connection.createChannel() (It waits does not throw and exception).
> Is there something wrong in what I am doing or is it an issue with the 
> 2.1.0 library.
>
> Thanks and Regards
> -Abhishek Kona
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the rabbitmq-discuss mailing list