1 2 3 4 Previous Next 46 Replies Latest reply on Feb 19, 2009 9:49 AM by ataylor Go to original post
      • 15. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
        timfox

         

        "jesper.pedersen" wrote:
        So I'm working on this again...

        I'm focusing on the outbound part of the adaptor first - which exposes the JMS 1.1 API.

        Looking at ClientSessionFactoryImpl there are a lot of constructors - some with composite datatypes (such as TransportConfiguration) - so I think I'll focus on the
         public ClientSessionFactoryImpl(final String discoveryGroupName,
         final int discoveryGroupPort)
         throws Exception
        

        first. We can add support for the others along the way.


        ok


        FYI - configuration parameters to the resource adaptor are passed in through the ra.xml file - f.ex.
         <config-property>
         <description>The discovery group name</description>
         <config-property-name>DiscoveryGroupName</config-property-name>
         <config-property-type>java.lang.String</config-property-type>
         <config-property-value>myValue</config-property-value>
         </config-property>
        


        Or is there a better way to initialize the client API and get a ClientSession ?


        Better in what sense?

        • 16. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
          jesper.pedersen

           

          Better in what sense?


          Well, easier ;)

          But if you are ok with ending up configuration parameters for all the constructors in the ClientSessionFactoryImpl - I'm ok with it.

          Just makes it more difficult for the user to configure the adaptor - or at least requires good documentation on the matter.

          The archive will look like this btw:
          META-INF/
          META-INF/MANIFEST.MF
          META-INF/ra.xml
          jbm-ra.jar
          jbm-core-client.jar
          


          Shout if I'm missing something...

          • 17. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
            timfox

             

            "jesper.pedersen" wrote:
            Better in what sense?


            Well, easier ;)



            In order to create a session on the client side, you need to specify what server you are talking to *somehow*. I think you'll agree that.

            There are several ways of doing that in JBM, the simplest is just to specify the UDP group and port and let it auto-discover - that's what the simplest constructor does.

            I'm not sure how you'd make it easier than that. If you have any suggestions then I am open to suggestions...




            • 18. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
              jesper.pedersen

               

              I'm not sure how you'd make it easier than that. If you have any suggestions then I am open to suggestions...


              No, not currently - and as you state users needs to be able to configure the discovery.

              And most of the users will properly only use the discoveryGroupName and discoveryGroupPort constructor...


              • 19. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                timfox

                 

                "jesper.pedersen" wrote:


                And most of the users will properly only use the discoveryGroupName and discoveryGroupPort constructor...


                Yes, exactly, or users will use the other simple constructors which just takes the server address.

                In most cases they will just use the default values for the other settings, however those settings still need to be configurable for those users who do not want to use the defaults, but they can be optional params in the config.

                • 20. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                  jesper.pedersen

                  Mhmm, since the outbound part of the adaptor needs to expose the JMS 1.1 API it maybe would be better to use the jms.client package for the foundation instead of core.client.

                  E.g. the managed connection factory keeps a JBossConnectionFactory instance.

                  It seems like it would save a lot of duplicated work.

                  What are your thoughts on this ?

                  • 21. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                    jesper.pedersen

                    This could be done by using the jms.client classes directly and only extending the ones needed for RA specific functionality.

                    Or by implementing the classes in the RA and using the jms.client for a delegate.

                    • 22. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                      timfox

                       

                      "jesper.pedersen" wrote:
                      Mhmm, since the outbound part of the adaptor needs to expose the JMS 1.1 API it maybe would be better to use the jms.client package for the foundation instead of core.client.

                      E.g. the managed connection factory keeps a JBossConnectionFactory instance.

                      It seems like it would save a lot of duplicated work.

                      What are your thoughts on this ?


                      +1



                      • 23. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                        jesper.pedersen

                        Thanks, Tim - I'll go in this direction now.

                        We can always worry about the inbound part when we get to that.

                        • 24. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                          jesper.pedersen

                          Just a small update on the work - it is progressing nicely; I had to change the structure a bit but hopefully the outbound part will be ready next week.

                          The inbound part is smaller than the outbound part and builds on some of the same data structures.

                          I'll check the code in once it is ready - we can then do a code review - and then I'll start on the inbound part.

                          I'll keep you posted :)

                          • 25. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                            jesper.pedersen

                            Just a follow up on our discussion last Friday -- I think you are thinking about the inbound part of the RA after have gone over the JMS spec.

                            The generic JMS resource adapter uses the ServerSessionPool in its inbound part. This won't work with JBM 2.0 like you said as it isn't supported. So we will implement the inbound part a different way -- which we will figure out once the outbound part has been committed.

                            For now I'll finish up the outbound part - check with the jms.client implementation - and either commit or upload the patch to the JIRA issue.

                            That way it would be easier to discuss the inbound part.

                            • 26. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                              timfox

                               

                              "jesper.pedersen" wrote:
                              Just a follow up on our discussion last Friday -- I think you are thinking about the inbound part of the RA after have gone over the JMS spec.

                              The generic JMS resource adapter uses the ServerSessionPool in its inbound part. This won't work with JBM 2.0 like you said as it isn't supported. So we will implement the inbound part a different way -- which we will figure out once the outbound part has been committed.

                              For now I'll finish up the outbound part - check with the jms.client implementation - and either commit or upload the patch to the JIRA issue.

                              That way it would be easier to discuss the inbound part.


                              +1

                              • 27. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                                jesper.pedersen

                                So commit r5759 adds the structure for the outbound part of the RA.

                                The work is based on Adrian's work and include some of the settings to setup the connection to JBM 2.0.

                                Important places to look currently:

                                * JBMManagedConnectionFactory::setup
                                * JBMManagedConnection::setup
                                * ra.xml

                                Missing parts - to be completed:

                                * SerialVersionUIDs once all classes are complete
                                * Ability to specify all options for JBossConnectionFactory
                                * Verification of transaction / XA
                                * General testing (integration of JBM 2.0 + RA into AS)
                                * TCK testing

                                But look it over and send me your feedback.

                                • 28. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                                  jesper.pedersen

                                  Ok - so I have added support for two other constructors in JBossConnectionFactory. The rest of them are left as a TODO for the reader ;)

                                  Also SerialVersionUIDs have been added.

                                  I'll get going with the inbound part...

                                  • 29. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
                                    jesper.pedersen

                                    We are now at the fun part :)

                                    I've imported the activation spec + the activation (minus the DLQ stuff for now) into the repository.

                                    We now need to hook up the activation with number of sessions that handles the message processing.

                                    Since we can't use the ServerSessionPool / ServerSession for this we need to do it another way.

                                    We have the maximum number of sessions allowed from the activation spec - and we are currently using the JMS 1.1 API as the interface to the core.

                                    This basically means that we can only count on the receive() methods. But that lead us to the problem that we need to poll to see if there is a message to process :S

                                    So are there any internal API that would be better - or is there some JMS magic we can use ?

                                    We can use all the JBM classes as this is a specific RA...