jboss - Can we setup JMS communication without username and password? -


i working in jboss environment , implemented jms enabling asynchronous communication between 2 modules. need add user "add-user.sh" script. user information gets saved in application-users.properties , application-roles.properties. need hardcode username , password in messagepublisher class authenticate user following block of code -

final static string initial_context_factory = "org.jboss.naming.remote.client.initialcontextfactory"; context context=null; final properties env = new properties(); env.put(context.initial_context_factory, initial_context_factory); env.put(context.provider_url, system.getproperty(context.provider_url, provider_url)); env.put(context.security_principal, system.getproperty("username", "abcd")); env.put(context.security_credentials, system.getproperty("password", "xyz"));  context = new initialcontext(env); 

but want bypass step of username , password. know in activemq possible setting <simpleauthenticationplugin anonymousaccessallowed="true">similarly can same thing in jms?

i found in standalone.xml there entry -

<security-settings>   <security-setting match="#">     <permission type="send" roles="guest"/>     <permission type="consume" roles="guest"/>     <permission type="createnondurablequeue" roles="guest"/>     <permission type="deletenondurablequeue" roles="guest"/>   </security-setting> </security-settings> 

i sure need modify section, didn't found reference.

how can allow anonymous username send messages jms queue or topic?

thanks in advance...

after research found out answer.

in standalone.xml file under messaging subsystem - remove following lines –

<security-settings> <security-setting match="#"> <permission type="send" roles="guest"/> <permission type="consume" roles="guest"/> <permission type="createnondurablequeue" roles="guest"/> <permission type="deletenondurablequeue" roles="guest"/> </security-setting> 

instead add following line in same place –

<security-enabled>false</security-enabled> 

under remoting subsystem need remove security-realm entry. remove line -

<connector name="remoting-connector" socket-binding="remoting" security-realm="applicationrealm"/> 

and add line -

<connector name="remoting-connector" socket-binding="remoting"/> 

with can following -

// set context jndi lookup final properties env = new properties(); env.put(context.initial_context_factory, initial_context_factory); env.put(context.provider_url, system.getproperty(context.provider_url, provider_url)); // username , password not required //env.put(context.security_principal, "username"); //env.put(context.security_credentials, "password"); context = new initialcontext(env);  // create jms connection, session, producer, , consumer // no need pass username , password when create connection //connection = connectionfactory.createconnection("usernme", "password"); connection = connectionfactory.createconnection(); 

thanks nirmalya


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -