You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Avinash <av...@gmail.com> on 2014/10/02 08:17:03 UTC

How to change the default port (1099) used by ActiveMq in apache camel?

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.

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Andreas Gies <an...@wayofquality.de>.
You can always configure the Brokerservice programmatically if the Spring
config doesn't work for you.

Best regards
Andreas


On 08/10/14 06:48, Avinash wrote:
> 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@wayofquality.de <ma...@wayofquality.de>

/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.

//

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Avinash <av...@gmail.com>.
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.

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Tim Bain <tb...@alumni.duke.edu>.
See also
http://stackoverflow.com/questions/7725202/configure-jmx-for-activemq-for-remoting-access
.

On Mon, Oct 6, 2014 at 9:11 AM, Tim Bain <tb...@alumni.duke.edu> wrote:

> 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.
>
> On Mon, Oct 6, 2014 at 1:12 AM, Avinash <av...@gmail.com>
> wrote:
>
>> 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.
>>
>
>

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Tim Bain <tb...@alumni.duke.edu>.
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.

On Mon, Oct 6, 2014 at 1:12 AM, Avinash <av...@gmail.com>
wrote:

> 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.
>

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Avinash <av...@gmail.com>.
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.

Re: How to change the default port (1099) used by ActiveMq in apache camel?

Posted by Tim Bain <tb...@alumni.duke.edu>.
Do you already have another process listening on port 1099?

On Thu, Oct 2, 2014 at 12:17 AM, Avinash <av...@gmail.com>
wrote:

> 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.
>