-
1. Re: problem running embedded sample on HornetQ 2.4.1
ataylor Apr 9, 2014 10:58 AM (in response to yairogen)have you created the appropriate acceptors in your hornetq-configuration.xml
-
2. Re: problem running embedded sample on HornetQ 2.4.1
jbertram Apr 9, 2014 11:07 AM (in response to yairogen)You might try looking at the embedded example we ship with HornetQ. It's in the examples/core/embedded directory in our distribution.
-
3. Re: problem running embedded sample on HornetQ 2.4.1
yairogen Apr 22, 2014 7:39 AM (in response to ataylor)The examples don't contain a configuration example only source code. Where can I find info on embedded acceptors configuration?
-
4. Re: problem running embedded sample on HornetQ 2.4.1
jbertram Apr 22, 2014 10:26 AM (in response to yairogen)1 of 1 people found this helpfulThere are 2 embedded examples shipped with HornetQ:
- embedded
- embedded-simple
The first is an example of programmatic configuration. There are no configuration files, just code.
The second is an example of file-based configuration. There are configuration files and code.
-
5. Re: problem running embedded sample on HornetQ 2.4.1
yairogen Apr 22, 2014 10:44 AM (in response to jbertram)Thanks, I see that embedded-simple is for jms. I'm looking for example of embedded using core and file based configuration. Can you help?
-
6. Re: problem running embedded sample on HornetQ 2.4.1
jbertram Apr 22, 2014 11:03 AM (in response to yairogen) -
7. Re: Re: problem running embedded sample on HornetQ 2.4.1
yairogen Apr 22, 2014 2:08 PM (in response to jbertram)Huh?
I've tried the code in the above first post with the below configuration file. doesn't work.
<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd"> <paging-directory>${data.dir:../data}/paging</paging-directory> <bindings-directory>${data.dir:../data}/bindings</bindings-directory> <journal-directory>${data.dir:../data}/journal</journal-directory> <journal-min-files>10</journal-min-files> <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory> <connectors> <connector name="netty"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class> <param key="host" value="${hornetq.remoting.netty.host:localhost}"/> <param key="port" value="${hornetq.remoting.netty.port:5445}"/> </connector> <connector name="netty-throughput"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class> <param key="host" value="${hornetq.remoting.netty.host:localhost}"/> <param key="port" value="${hornetq.remoting.netty.batch.port: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="${hornetq.remoting.netty.host:localhost}"/> <param key="port" value="${hornetq.remoting.netty.port:5445}"/> </acceptor> <acceptor name="netty-throughput"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class> <param key="host" value="${hornetq.remoting.netty.host:localhost}"/> <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </acceptor> </acceptors> <security-settings> <security-setting match="#"> <permission type="createNonDurableQueue" roles="guest"/> <permission type="deleteNonDurableQueue" roles="guest"/> <permission type="consume" roles="guest"/> <permission type="send" roles="guest"/> </security-setting> </security-settings> <address-settings> <!--default for catch all--> <address-setting match="#"> <dead-letter-address>jms.queue.DLQ</dead-letter-address> <expiry-address>jms.queue.ExpiryQueue</expiry-address> <redelivery-delay>0</redelivery-delay> <max-size-bytes>10485760</max-size-bytes> <message-counter-history-day-limit>10</message-counter-history-day-limit> <address-full-policy>BLOCK</address-full-policy> </address-setting> </address-settings> </configuration>
-
8. Re: Re: problem running embedded sample on HornetQ 2.4.1
jbertram Apr 22, 2014 2:36 PM (in response to yairogen)What's the name of your configuration file? Is it hornetq-configuration.xml? If so, is it on your classpath? By default org.hornetq.core.server.embedded.EmbeddedHornetQ will load hornetq-configuration.xml from the classpath. If it's named differently or not on your classpath then you'll need to invoke setConfigResourcePath(String) as appropriate.
-
9. Re: Re: problem running embedded sample on HornetQ 2.4.1
yairogen Apr 22, 2014 3:10 PM (in response to jbertram)Yes and Yes. The right file name and it is in the classpath. Verified by changing the file name to "hornetq-configuration-1.xml" and then I see this error:
java.net.MalformedURLException: no protocol: hornetq-configuration.xml
So the file name was right and reverting back to "hornetq-configuration.xml" but it still fails on:
HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:905)
-
10. Re: Re: Re: problem running embedded sample on HornetQ 2.4.1
jbertram Apr 22, 2014 3:25 PM (in response to yairogen)I believe I see the issue now. Although you call it "nettyFactory" you are actually trying to connect using an in-vm connector, e.g.:
ClientSessionFactory nettyFactory = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getName())).createSessionFactory();
However, your configuration doesn't have an in-vm acceptor. Andy asked you about this in the first response on this thread almost 2 weeks ago.
-
11. Re: Re: problem running embedded sample on HornetQ 2.4.1
yairogen Apr 23, 2014 8:33 AM (in response to jbertram)I Probably missed that. Can you please share a in-vm acceptor configuration?
I tried adding:
<acceptor name="in-vm"> <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class> </acceptor>
But this resulted with:
HornetQSecurityException[errorType=SECURITY_EXCEPTION message=HQ119031: Unable to validate user: null]
at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:394)
Adding the following resolved my issue and tests finally passes:
<security-enabled>false</security-enabled>