I fire up a hornetq instance, and i keep getting messages like:
[java] 2015-03-25 15:07:03,068 INFO org.hornetq.core.server.impl.HornetQServerImpl:1185 [pool-2-thread-1] [deployQueue] HQ221003: trying to deploy queue jms.queue.my_queue
Over and over, once every 5s per queue.
I'm not sure why you're seeing this logging over and over. Can you attach the full log where you see this along with your configuration and an explanation of your use-case?
Ok, so the first thing to note is that i'm not starting a server using the out-of-the-box scripts. I'm starting the server using java code, via the hornet API:
FileConfiguration config = new FileConfiguration();
HornetQServer server = HornetQServers.newHornetQServer(config);
serverManager = new JMSServerManagerImpl(server, "hornetq-jms.xml");
If i start the server using the scripts, then i do NOT see the repeated "trying to deploy" messages.
In the java case, the "trying to deploy" messages start right away, below are the first few lines of the log:
[java] 2015-03-26 15:01:11,496 WARN org.hornetq.core.deployers.impl.FileConfigurationParser:514 [main] [parseMainConfig] HQ222018: AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
[java] 2015-03-26 15:01:11,569 INFO org.hornetq.core.server.impl.HornetQServerImpl:411 [main] [start] HQ221000: live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=../data/journal,bindingsDirectory=../data/bindings,largeMessagesDirectory=../data/large-messages,pagingDirectory=../data/paging)
[java] 2015-03-26 15:01:11,581 WARN org.hornetq.core.server.impl.HornetQServerImpl:1514 [main] [initialisePart1] HQ222007: Security risk! HornetQ is running with the default cluster admin user and default password. Please see the HornetQ user guide, cluster chapter, for instructions on how to change this.
[java] 2015-03-26 15:01:11,595 INFO org.hornetq.core.remoting.server.impl.RemotingServiceImpl:155 [main] [<init>] HQ221043: Adding protocol support CORE
[java] 2015-03-26 15:01:11,600 INFO org.hornetq.core.remoting.server.impl.RemotingServiceImpl:169 [main] [<init>] HQ221043: Adding protocol support STOMP
[java] 2015-03-26 15:01:11,690 INFO org.hornetq.core.server.impl.HornetQServerImpl:1185 [main] [deployQueue] HQ221003: trying to deploy queue jms.queue.my_queue
The other thing i noticed with the java startup, is that a <queues> entry in hornetq-configuration.xml doesn't take; I have to add <queue> entries to the hornetq-jms.xml in order to see the queues. In contrast, with the out-of-the-box scripts, a <queues> entry in hornetq-configuration.xml is picked up fine.
This is with 2.4.0.Final btw.
Is your goal simply to start an embedded HornetQ JMS server? If so, check out the "embedded-simple" example that's shipped with HornetQ. It takes just 2 lines of code (assuming your configuration files are named using the defaults):
EmbeddedJMS jmsServer = new EmbeddedJMS(); jmsServer.start();
That is essentially what i'm trying to do, fire up an embedded server. I'll look into this "EmbeddedJMS" class, see if that does the trick. Thanks.
I really needed to specify the config file programmatically, and i found that the issue had to do with the classpath of the config file.
If i specify a config file of "hornetq-jms.xml" (ie, at the root of the classpath), then i don't get the msgs. If i specify "/com/blah/hornetq-jms.xml", then i do.
Debug logging shows constant messages like the below when "/com/blah/hornetq-jms.xml" is specified:
hornet-main.log:DEBUG | 04-07-2015 20:45:54.014 | pool-2-thread-1 | org.hornetq.core.deployers.impl.FileDeploymentManager(247) | Undeploying org.hornetq.jms.server.impl.JMSServerDeployer@57f4bf33 with url file:/C:/git/project/target/classes/com/blah/hornetq-jms.xml
If "hornetq-jms.xml" is used, then i don't see the "Undeploying" messages at all.
But again, in both cases, everything seems to work fine behavior-wise. It's just the annoying messages that keep appearing over and over.
So what code are you using at this point where you see the annoying messages? Perhaps you could modify one of the embedded HornetQ examples to reproduce exactly what you're seeing so I could reproduce it locally.