-
1. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 26, 2012 8:35 AM (in response to adryen31)1 of 1 people found this helpfulim not sure what you mean by disacotiate, each hornetq will be crated distinct of the other, you will have to give us more info if you want some help.
is there a reason you need 4 hornetq servers, why dont you just deploy one and use different destinations for each app, that would make more sense.
-
2. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 26, 2012 8:58 AM (in response to adryen31)Thank Andy,
I can deploy just one hornetq for the 4 webapps, because each webapps package one hornetq ...
I means by dissociate: 1 webapp publish one message on own hornetq, but the result that
each other webapp (with each own hornetq instance) get also the same message ...
perhaps because each hornetq-configuration.xml have same connector and acceptor:
<connectors>
<connector name="netty">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="localhost"/>
<param key="port" value="5445"/>
</connector>
<connector name="netty-throughput">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="localhost"/>
<param key="port" value="5455"/>
<param key="batch-delay" value="50"/>
</connector>
</connectors>
<acceptors>
<acceptor name="netty">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="localhost"/>
<param key="port" value="5445"/>
</acceptor>
<acceptor name="netty-throughput">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="localhost"/>
<param key="port" value="5455"/>
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</acceptor>
</acceptors>
-
3. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 26, 2012 9:36 AM (in response to adryen31)1 of 1 people found this helpfulobviously each server would need to be configured to use a different port. I cant see the point tho in deploying a whole server for each app, it doesnt really make sense. deploy 1 server and then all apps can use it.
-
4. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 26, 2012 9:50 AM (in response to ataylor)Thank Andy, I will try with 4 acceptor/connector different ports. I know, most infrastructure should be 1 server and all apps use it, but it's an already existing infrastructure which should not be modified ...
-
5. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 9:12 AM (in response to adryen31)Hello Andy,
I have try with 4 following attached hornetq-configuration files and my messages continue to be published on 4 different instances ...
more which is weird, when I look listen/etablished server port following line were displayed (netstat command):
tcp6 0 0 localhost:5443 [::]:* LISTEN
tcp6 0 0 localhost:5445 [::]:* LISTEN
tcp6 0 0 localhost:5447 [::]:* LISTEN
tcp6 0 0 localhost:5449 [::]:* LISTEN
tcp6 0 0 localhost:5453 [::]:* LISTEN
tcp6 0 0 localhost:5455 [::]:* LISTEN
tcp6 0 0 localhost:5457 [::]:* LISTEN
tcp6 0 0 localhost:5459 [::]:* LISTEN
En revanche je n'ai que :
tcp6 0 0 localhost:5445 localhost:54378 ESTABLISHED
tcp6 0 0 localhost:5445 localhost:38851 ESTABLISHED
tcp6 0 0 localhost:5445 localhost:38861 ESTABLISHED
-
hornetq-config4.xml 3.5 KB
-
hornetq-config3.xml 3.6 KB
-
hornetq-config2.xml 3.6 KB
-
hornetq-config1.xml 3.6 KB
-
-
6. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 9:26 AM (in response to adryen31)to be honest, I have no idea, what tomcat/spring is doing. If tou can provide me with an example project i can use to build/run your examples i could take a look. or you could debug it yourself. I cant see how the same message can be sent to multiple servers tho.
-
7. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 9:53 AM (in response to ataylor)I don't know why it behaves as this, but you think it may come from tomcat ?
hornetq at no time can share their configuration or ports?
I very difficult for me to provide my project because, it's my enterprise webapp ... and it isn't open source
I seach on tomcat side, for the moment
-
8. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 10:55 AM (in response to adryen31)we have lots of tests that do this, start lots of servers, unl;ess you have some sort of weird mis configuration i cant see it happening, or maybe you are just mis reading what you are seeing.
I doubt the tomcat guys can help you unless your more specific with your problem, cant you just write a simple example that does something similar to your app
-
9. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 11:04 AM (in response to ataylor)I think I have found the problem but not sure ...
Imagine all my applications send
this.clientProducer.send(address, clientMessage);
with address = "myAddress"
but all of each have "MyAddress" and not "MyAddress1", "MyAddress2", "MyAddress3", "MyAddress4"
Each address must be unique ? Even if each hornetq configuration file have not same port, and journal,page,binding-directory ...
they share the same address publication?
-
10. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 11:49 AM (in response to adryen31)the only way that can happen is if somehow you have made your servers form a cluster
-
11. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 11:52 AM (in response to ataylor)Yes that's what I thought but I have this for each application ...
INFO: live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=C:\res\hornetq\journal,bindingsDirectory=C:\res\hornetq\bindings,largeMessagesDirectory=C:\res\hornetq\large-messages,pagingDirectory=C:\res\hornetq\paging)
I have investigate, if in the first application I send a message to "myaddress" all MessageHandler of the 4 applications receive the message ...
-
12. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 11:54 AM (in response to adryen31)are all your servers using the same journal? if so this is wrong, each server should use their own journal
-
13. Re: How to dissociate 4 HornetQ in same Tomcat
adryen31 Oct 30, 2012 11:57 AM (in response to ataylor)Conf 1:
<paging-directory>/var/webapps/formation/hornetq/paging</paging-directory>
<bindings-directory>/var/webapps/formation/hornetq/bindings</bindings-directory>
<journal-directory>/var/webapps/formation/hornetq/journal</journal-directory>
Conf 2:
<paging-directory>/var/webapps/demo_master/hornetq/paging</paging-directory>
<bindings-directory>/var/webapps/demo_master/hornetq/bindings</bindings-directory>
<journal-directory>/var/webapps/demo_master/hornetq/journal</journal-directory>
Conf 3:
<paging-directory>/var/webapps/demo_backup/hornetq/paging</paging-directory>
<bindings-directory>/var/webapps/demo_backup/hornetq/bindings</bindings-directory>
<journal-directory>/var/webapps/demo_backup/hornetq/journal</journal-directory>
Conf 4:
<paging-directory>/var/webapps/ROOT/hornetq/paging</paging-directory>
<bindings-directory>/var/webapps/ROOT/hornetq/bindings</bindings-directory>
<journal-directory>/var/webapps/ROOT/hornetq/journal</journal-directory>
-
14. Re: How to dissociate 4 HornetQ in same Tomcat
ataylor Oct 30, 2012 12:01 PM (in response to adryen31)so thats a no then, well unless you can provide me something i can debug i cant really help you much more.