You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by akhil <ak...@gmail.com> on 2016/05/13 12:41:00 UTC

How can i get Broker Service instance of the remote broker ?

I have a use case where i have to get the broker service instance for the
remote broker or getting the remote broker instance. I have tried in
creating broker service instance and adding the remote connector uri address
but thats not helping me to get the region broker and i am in need of region
broker . Please suggest or throw up some snippets which relates to the
remote broker service instance and remote region broker instance.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can i get Broker Service instance of the remote broker ?

Posted by akhil <ak...@gmail.com>.
yes , i have to have the session count because of one reason we had a very
bad problem with one of the producer while performing a heavy load test
where client never closed their sessions in this test and with in a short
amount of time broker going down and we had the issue when we do restarts as
well since sessions are getting reestablished even after restarts where load
test always tries to reconnect that and when we got into the heap dump and
analyzed that . The heap analysis stated that there were a large number of
session objects got created they were stating in the heap and not getting
into the step of Garbage Collection. So we thought it would be the good idea
to help out our monitoring to get this statistics of session count. As this
is  very short in explaining now but we had a very hard time in finding the
root cause for this since we had a very big MOM platform.

Connection count and all other related stuff we are aware of that and that
metrics wont be useful in this case.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4712035.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can i get Broker Service instance of the remote broker ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
The broker MBean exposes TotalConnectionsCount, TotalConsumerCount, and
TotalProducerCount; do you actually need the session count?  (If so, why?
What are you actually trying to accomplish with your monitoring, and how
does session count help you accomplish it?)

Tim
On May 16, 2016 10:51 AM, "akhil" <ak...@gmail.com> wrote:

> Hi Tim ,
>
> I am sorry i didn't explain the correct use case , what i am doing here is
> trying to get the total session count on the remote broker  from my java
> client and to display on our monitoring tool. At this point i am just
> trying
> to get this with the help of region broker instance which intern needs a
> broker service instance ..and this broker service instance is not exposed
> as
> an mbean where i have to write a plugin on the remote broker where it
> should
> expose broker service as an mbean. Then i can consume this Broker Service
> instance as an mbean to get the region broker instance and can get the
> session count. What i thought before is ..is there any way i can get this
> broker service instance of remote broker with out writing the plugin ..?
>
> Now i am clear that there is no way other than writing the plugin for
> broker
> service.
>
> Thank you once again for making it clear.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711985.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: How can i get Broker Service instance of the remote broker ?

Posted by akhil <ak...@gmail.com>.
Hi Tim , 

I am sorry i didn't explain the correct use case , what i am doing here is
trying to get the total session count on the remote broker  from my java
client and to display on our monitoring tool. At this point i am just trying
to get this with the help of region broker instance which intern needs a
broker service instance ..and this broker service instance is not exposed as
an mbean where i have to write a plugin on the remote broker where it should
expose broker service as an mbean. Then i can consume this Broker Service
instance as an mbean to get the region broker instance and can get the
session count. What i thought before is ..is there any way i can get this
broker service instance of remote broker with out writing the plugin ..?

Now i am clear that there is no way other than writing the plugin for broker
service.

Thank you once again for making it clear.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711985.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can i get Broker Service instance of the remote broker ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
You haven't told us what you're actually trying to do with the reference to
the broker (which means there is a non-trivial risk that this is an X-Y
problem -
http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem), so
JMX might or might not allow you to do whatever it is.  But if JMX allows
it, then yes, what you described is roughly what you'd need to do to use
JMX.

Tim
On May 15, 2016 9:25 PM, "akhil" <ak...@gmail.com> wrote:

> Yes , the client is running as a separate process from the broker . based
> on
> what you said , i have to expose the broker service as an mbean which can
> run on the broker machine and through JMX i have to get that mbean and
> associated region broker.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711968.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: How can i get Broker Service instance of the remote broker ?

Posted by akhil <ak...@gmail.com>.
Yes , the client is running as a separate process from the broker . based on
what you said , i have to expose the broker service as an mbean which can
run on the broker machine and through JMX i have to get that mbean and
associated region broker. 



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711968.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can i get Broker Service instance of the remote broker ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
Is your already-running broker running in the same process as your client?
Or are you trying to interact with a broker that's in a separate process?
If the latter, I don't think what you're trying to do will work; you should
see whether the JMX API (which will work with a separate process) will meet
your needs.

Tim
On May 14, 2016 10:59 PM, "akhil" <ak...@gmail.com> wrote:

> Hi Tim ,
>
> I am writing a simple java client to get the broker service instance of my
> remote broker which is in dev environment. I have seen several examples
> related to brokers service which they are starting up locally and using
> that
> local instance ..But in my case the brokers are already up and running and
> would like to get that broker service instance of the dev broker.
>
> Here is the sample case :
>         // The below one is through factory
>         BrokerService remoteBroker = BrokerFactory.createBroker(new
> URI("vm://brokername"));
>
> Where i am trying to get the region broker out of this remotebroker. I have
> to have the proper broker service instance with all the instance variables
> population with my remote broker uri then i am able to use the region
> broker.
>
> Thanks,
> Akhil.
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711945.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: How can i get Broker Service instance of the remote broker ?

Posted by akhil <ak...@gmail.com>.
Hi Tim , 

I am writing a simple java client to get the broker service instance of my
remote broker which is in dev environment. I have seen several examples
related to brokers service which they are starting up locally and using that
local instance ..But in my case the brokers are already up and running and
would like to get that broker service instance of the dev broker.

Here is the sample case :
        // The below one is through factory
	BrokerService remoteBroker = BrokerFactory.createBroker(new
URI("vm://brokername"));

Where i am trying to get the region broker out of this remotebroker. I have
to have the proper broker service instance with all the instance variables
population with my remote broker uri then i am able to use the region
broker.

Thanks,
Akhil.




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891p4711945.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can i get Broker Service instance of the remote broker ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
Others might, but I don't understand what you're asking.  Can you explain,
or maybe post the code you're trying to get working?
On May 13, 2016 9:45 AM, "akhil" <ak...@gmail.com> wrote:

> I have a use case where i have to get the broker service instance for the
> remote broker or getting the remote broker instance. I have tried in
> creating broker service instance and adding the remote connector uri
> address
> but thats not helping me to get the region broker and i am in need of
> region
> broker . Please suggest or throw up some snippets which relates to the
> remote broker service instance and remote region broker instance.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>