Discussion:
How to change the default port (1099) used by ActiveMq in apache camel?
Avinash
2014-10-02 06:17:03 UTC
Permalink
Hi,
Please don't consider this as duplicate question. I searched regarding this
issue on Internet and could not find a proper answer. Hence posting it here.

*Problem Description*
I am using Apache Camel and in Camel-Config.xml, I have given the activeMq
properties as below

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="vm://localhost?broker.persistent=false&amp;broker.useJmx=true"
/>
</bean>
</property>
</bean>


When I start my application I am getting below error,
Failed to start jmx connector: Cannot bind to URL
[rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException

This is because port is already bound.
I am trying to change the port from 1099 to another port but unable to do
so.
Can anyone please guide on this?



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Tim Bain
2014-10-03 19:04:18 UTC
Permalink
Do you already have another process listening on port 1099?
Post by Avinash
Hi,
Please don't consider this as duplicate question. I searched regarding this
issue on Internet and could not find a proper answer. Hence posting it here.
*Problem Description*
I am using Apache Camel and in Camel-Config.xml, I have given the activeMq
properties as below
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="vm://localhost?broker.persistent=false&amp;broker.useJmx=true"
/>
</bean>
</property>
</bean>
When I start my application I am getting below error,
Failed to start jmx connector: Cannot bind to URL
[rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException
This is because port is already bound.
I am trying to change the port from 1099 to another port but unable to do
so.
Can anyone please guide on this?
--
http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Avinash
2014-10-06 07:12:30 UTC
Permalink
Yes, there is another application running on port 1099 and so I want my app
to use some other port.
But not sure where to change the port number.

I tried giving in the VM url as below but of no use. It always picks 1099

vm://localhost:4000?broker.persistent=false&amp;broker.useJmx=true



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081p4686154.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Tim Bain
2014-10-06 15:11:57 UTC
Permalink
You need to set the connectorPort property on the ManagementContext to the
port number you want to use, as described in
http://activemq.apache.org/jmx.html. It doesn't go in the URI that the
clients use to connect to the broker; that's a different port entirely.
Post by Avinash
Yes, there is another application running on port 1099 and so I want my app
to use some other port.
But not sure where to change the port number.
I tried giving in the VM url as below but of no use. It always picks 1099
vm://localhost:4000?broker.persistent=false&amp;broker.useJmx=true
--
http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081p4686154.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Tim Bain
2014-10-06 20:56:19 UTC
Permalink
See also
http://stackoverflow.com/questions/7725202/configure-jmx-for-activemq-for-remoting-access
.
Post by Tim Bain
You need to set the connectorPort property on the ManagementContext to the
port number you want to use, as described in
http://activemq.apache.org/jmx.html. It doesn't go in the URI that the
clients use to connect to the broker; that's a different port entirely.
Post by Avinash
Yes, there is another application running on port 1099 and so I want my app
to use some other port.
But not sure where to change the port number.
I tried giving in the VM url as below but of no use. It always picks 1099
vm://localhost:4000?broker.persistent=false&amp;broker.useJmx=true
--
http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081p4686154.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Avinash
2014-10-08 04:48:34 UTC
Permalink
But In this case, there is no activeMq.xml where I can add the
ManagementContext.
I am using activemq-broker and activemq-client jars.

I tried giving in the camel-config.xml but it throws saxparser error.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081p4686218.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Andreas Gies
2014-10-08 08:03:13 UTC
Permalink
You can always configure the Brokerservice programmatically if the Spring
config doesn't work for you.

Best regards
Andreas
Post by Avinash
But In this case, there is no activeMq.xml where I can add the
ManagementContext.
I am using activemq-broker and activemq-client jars.
I tried giving in the camel-config.xml but it throws saxparser error.
--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-change-the-default-port-1099-used-by-ActiveMq-in-apache-camel-tp4686081p4686218.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
Andreas Gies

WoQ -- Way of Quality GmbH

Geschäftsführer & CTO

/eMail:/andreas-7A/***@public.gmane.org <mailto:andreas-7A/***@public.gmane.org>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/>
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)

/Xing:/ <http://www.xing.com/profile/Andreas_Gies>
(http://www.xing.com/profile/Andreas_Gies)

/Blog:/ <http://www.wayofquality.de/index.php/en/blog>
(http://www.wayofquality.de/index.php/en/blog)

/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte
Informationen enthalten und ist ausschließlich für den/die benannten
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie
bitte sofort den Absender telefonisch oder per Email und löschen Sie
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen
haben.


Disclaimer

This email may contain confidential and/or privileged information and is
intended solely for the attention and use of the named addressee(s). If
you are not the intended recipient, or a person responsible for
delivering it to the intended recipient, you are not authorized to and
must not disclose, copy, distribute, or retain this message or any part
of it without our authority. Please contact the sender by call or reply
email immediately and destroy all copies and the original message. We
are not responsible for the integrity of emails after they have left our
sphere of control.

//
Loading...