Is it possible to use HornetQ as beans without JNDI (even if it is behind some kind of abstraction) ...?

My initial problem was trying to discover and implement HornetQ with a minimum of dependencies.

One element that I would like to avoid is the need for JNDI. I believe that it should be possible to localize all objects directly, rather than making jndi locator objects.

I'm not a jndi fan because it looks like a global bucket of crap where you have to keep track of names, make sure they don’t conflict with other things, etc., many things that seem wrong when you remember that good abstractions give minimal information the public.

By the way, this is not just an ambiguous general observation ...

+3
source share
1

q, , EmbeddedExample.java, "", JNDI..

 // Step 1. Create the Configuration, and set the properties accordingly
     Configuration configuration = new ConfigurationImpl();
     configuration.setPersistenceEnabled(false);
     configuration.setSecurityEnabled(false);
     configuration.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

     // Step 2. Create and start the server
     HornetQServer server = HornetQServers.newHornetQServer(configuration);
     server.start();

     // Step 3. As we are not using a JNDI environment we instantiate the objects directly
     ClientSessionFactory sf = HornetQClient.createClientSessionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()));

     // Step 4. Create a core queue
     ClientSession coreSession = sf.createSession(false, false, false);
+4

Source: https://habr.com/ru/post/1782718/


All Articles