You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Hartmut Lang <ha...@ericsson.com> on 2009/02/04 11:20:25 UTC

how to close JMS conduit to activeMq

Currently we run  cxf 2.0.9 over JMS with an activeMQ broker.

We have some clients which do not too often send messages. So we want to
shutdown these clients.

One reason for this is that we see the number of threads and number of
temporary queues increasing in our activeMQ broker.

So far I could not achieve, that the connection to the broker actually
gets closed. At least I could manage to shutdown the backchannel. 

What can I do to completely close the connection to the broker?

 

Here the code we use for closing the backchannel

            Client client = ClientProxy.getClient(clientPort);

            JMSConduit conduit = (JMSConduit) client.getConduit();

            Destination backChannel = conduit.getBackChannel();

            backChannel.shutdown();

            conduit.close;

 

Thanks,

Hartmut


Re: how to close JMS conduit to activeMq

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Hartmut,

if you are concerned about the number of temporary queues you should 
perhaps take a look at the current version of cxf (2.1.3) or soon 2.1.4.
It uses only one temporary queue per conduit the threads are also 
configurable.

I am just checking if a close of the connection is possible in the 
current version.

Greetings

Christian

Hartmut Lang schrieb:
> Currently we run  cxf 2.0.9 over JMS with an activeMQ broker.
>
> We have some clients which do not too often send messages. So we want to
> shutdown these clients.
>
> One reason for this is that we see the number of threads and number of
> temporary queues increasing in our activeMQ broker.
>
> So far I could not achieve, that the connection to the broker actually
> gets closed. At least I could manage to shutdown the backchannel. 
>
> What can I do to completely close the connection to the broker?
>
>  
>
> Here the code we use for closing the backchannel
>
>             Client client = ClientProxy.getClient(clientPort);
>
>             JMSConduit conduit = (JMSConduit) client.getConduit();
>
>             Destination backChannel = conduit.getBackChannel();
>
>             backChannel.shutdown();
>
>             conduit.close;
>
>  
>
> Thanks,
>
> Hartmut
>
>
>   


-- 

Christian Schneider
---
http://www.liquid-reality.de


RE: how to close JMS conduit to activeMq

Posted by Hartmut Lang <ha...@ericsson.com>.
Christian,

thanks, this seems to work also in cxf 2.0.x.
I agree that this is not a clean solution, since we have to know that
there is a SingleConnectionFactory used inside of cxf.
But at least it works.

Thanks,
Hartmut

-----Original Message-----
From: Christian Schneider [mailto:chris@die-schneider.net] 
Sent: Donnerstag, 5. Februar 2009 08:48
To: users@cxf.apache.org
Subject: Re: how to close JMS conduit to activeMq

Hi Hartmut,

I have found a way to close the connection for cxf 2.1.3 and 2.1.4. It 
is not very clean though. So perhaps this should be included in 
JMSConduit.close();

        Client client = ClientProxy.getClient(customerService);
        JMSConduit co = (JMSConduit)client.getConduit();
        co.close();
        SingleConnectionFactory cf = 
(SingleConnectionFactory)co.getJmsConfig().getOrCreateWrappedConnectionF
actory(); 
// use getConnectionFactory for 2.1.3
        cf.destroy();

Greetings

Christian

Hartmut Lang schrieb:
> Currently we run  cxf 2.0.9 over JMS with an activeMQ broker.
>
> We have some clients which do not too often send messages. So we want
to
> shutdown these clients.
>
> One reason for this is that we see the number of threads and number of
> temporary queues increasing in our activeMQ broker.
>
> So far I could not achieve, that the connection to the broker actually
> gets closed. At least I could manage to shutdown the backchannel. 
>
> What can I do to completely close the connection to the broker?
>
>  
>
> Here the code we use for closing the backchannel
>
>             Client client = ClientProxy.getClient(clientPort);
>
>             JMSConduit conduit = (JMSConduit) client.getConduit();
>
>             Destination backChannel = conduit.getBackChannel();
>
>             backChannel.shutdown();
>
>             conduit.close;
>
>  
>
> Thanks,
>
> Hartmut
>
>
>   


-- 

Christian Schneider
---
http://www.liquid-reality.de


Re: how to close JMS conduit to activeMq

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Hartmut,

I have found a way to close the connection for cxf 2.1.3 and 2.1.4. It 
is not very clean though. So perhaps this should be included in 
JMSConduit.close();

        Client client = ClientProxy.getClient(customerService);
        JMSConduit co = (JMSConduit)client.getConduit();
        co.close();
        SingleConnectionFactory cf = 
(SingleConnectionFactory)co.getJmsConfig().getOrCreateWrappedConnectionFactory(); 
// use getConnectionFactory for 2.1.3
        cf.destroy();

Greetings

Christian

Hartmut Lang schrieb:
> Currently we run  cxf 2.0.9 over JMS with an activeMQ broker.
>
> We have some clients which do not too often send messages. So we want to
> shutdown these clients.
>
> One reason for this is that we see the number of threads and number of
> temporary queues increasing in our activeMQ broker.
>
> So far I could not achieve, that the connection to the broker actually
> gets closed. At least I could manage to shutdown the backchannel. 
>
> What can I do to completely close the connection to the broker?
>
>  
>
> Here the code we use for closing the backchannel
>
>             Client client = ClientProxy.getClient(clientPort);
>
>             JMSConduit conduit = (JMSConduit) client.getConduit();
>
>             Destination backChannel = conduit.getBackChannel();
>
>             backChannel.shutdown();
>
>             conduit.close;
>
>  
>
> Thanks,
>
> Hartmut
>
>
>   


-- 

Christian Schneider
---
http://www.liquid-reality.de