3 Replies Latest reply on Nov 8, 2009 5:13 AM by Nikolay Elenkov

    JMS & Authentication

    Ryan Kimber Newbie

      I've been successful in using Seam to connect to a queue and a topic that I've created in JBoss Messaging (on Jboss 5), but I haven't been able to find any documentation on authenticating the session (I've checked the reference documentation, looked at the source code, checked Seam In Action and the Seam Framework Revolution... books).


      I definitely need to protect the queues in this application with authentication. Is there a way to configure a usercode and password or do I need to create my own connection factory instance and manage it myself?


      Any guidance you can offer would be greatly appreciated!

        • 1. Re: JMS & Authentication
          Nikolay Elenkov Master

          First create your session 'manually' to verify it works:


          Connection conn = connectionFactory.createConnection("user", "password");
          Session session = conn.createSession(true, Session.AUTO_ACKNOLEDGE);
          



          Then, you can write a Seam component that creates one for you. Just add a username and password to Seam's QueueConnection and use those in the @Create method. Btw, you can have one component for both queue and topic connections if you use the JMS 1.1 API's (which the Seam classes don't)


          HTH

          • 2. Re: JMS & Authentication
            Ryan Kimber Newbie

            Thanks for the reply Nikolay, but this doesn't directly answer the question. I've done lots of JMS in the past - creating a connection, session and sending messages to the queue won't be a problem.


            However, it would be really nice if I could take advantage of the components built into Seam. Were they really created without including support for authentication? I seriously find it hard to believe that forward-thinking team behind Seam and Weld would have skipped authentication support?


            Is there really no support for passing a user-code and password to the Seam JMS components?

            • 3. Re: JMS & Authentication
              Nikolay Elenkov Master

              Ryan Kimber wrote on Nov 07, 2009 18:25:


              However, it would be really nice if I could take advantage of the components built into Seam. Were they really created without including support for authentication? I seriously find it hard to believe that forward-thinking team behind Seam and Weld would have skipped authentication support?

              Is there really no support for passing a user-code and password to the Seam JMS components?


              Did you really read the code? If you did you would've seen that there is no support for passing a username/password. So you should:



              1. Write a Seam component that does support authentication and use it your project. It is really easy, just look at Seam code

              2. File a feature request in JIRA with a patch

              3. Take it up with the Seam/Weld team :)