1 2 Previous Next 26 Replies Latest reply on Nov 30, 2007 6:19 AM by objectiser

    Notifications

    objectiser

      Hi

      I would like to know if JBoss ESB supports the ability to send notifications.

      From what I have read, and examples I have experimented with, it appears that the ESB is primarily geared to supporting the one-way request and request/response MEPs. This would be understandable as it would then enable the same services to be transparently used in a messaging and web service context.

      One approach that I see would be possible is that a service could 'notify' a client if the client also had a registered service interface, using the ServiceInvoker - although this requires that the service is tightly coupled to the client unless the client's service category/name is passed in an initial message (not ideal). This approach would also not work for pure clients.

      I would like to know whether the following scenario is feasible:

      Process A sends a request to Process B with a replyTo EPR (e.g. a temporary queue). The pipeline completes without returning a message, but the replyTo EPR is stored for later use.

      At some point in the future, the Process B retrieves the replyTo EPR and then sends a notification message back to the originator (Process A). In this scenario, the Process B only has the EPR - it has no service category or name, as in this case it was related to a temporary queue.

      If this situation is possible - how is the message sent, as ServiceInvoker requires a category and name?

      Is there any way to use an EPR to obtain the service category and name from which it was derived?

      Regards
      Gary

        • 1. Re: Notifications
          tfennelly

          Check out the "LogicalEPR" (don't you just love that name ;-) ). It allows you specify the reply-to based on the Service Category/Name.

          • 2. Re: Notifications
            marklittle

             

            "tfennelly" wrote:
            Check out the "LogicalEPR" (don't you just love that name ;-) ). It allows you specify the reply-to based on the Service Category/Name.


            Yeah, thank goodness we didn't give it a name like Smooks, eh ;-)?

            • 3. Re: Notifications
              objectiser

              Thanks - from the javadoc I assume I can use it to send the category/name from a client (that does support its own reply service interface) in the replyTo field, and then use it later on to return a notification.

              It also looks like I could use a temporary queue based replyTo EPR in the service, to construct a logicalEPR based on the PortReference, to send a notification back to a pure client?

              Will try both mechanisms out.

              Thanks again,
              Gary

              • 4. Re: Notifications
                tfennelly

                Yeah, good point.... that would have made even less sense ;-)

                • 5. Re: Notifications
                  marklittle

                  As Tom said, you could use the LogicalEPR approach. Alternatively you are free to add whatever extensions you want to the ReferenceProperties/ReferenceParameters section of the EPRs in the Message. Since these are available to the service you can implement that to pull those details out.

                  • 6. Re: Notifications
                    tfennelly

                     

                    "objectiser" wrote:
                    Thanks - from the javadoc I assume I can use it to send the category/name from a client (that does support its own reply service interface) in the replyTo field, and then use it later on to return a notification.


                    So I think you need to get your client to register it's JMS endpoint in the Registry. You said you didn't want the ESB to make the reply invocation, so whatever it is that's making the reply can use the ServiceInvoker supplied with the Service cat/name captured from the reply-to.

                    "objectiser" wrote:
                    It also looks like I could use a temporary queue based replyTo EPR in the service, to construct a logicalEPR based on the PortReference, to send a notification back to a pure client?

                    Will try both mechanisms out.


                    Not sure you'll get that to work, but feel free to experiment :-)

                    • 7. Re: Notifications
                      objectiser

                      However that would require both client and server to understand the extensions in the EPR.

                      Hopefully the LogicalEPR approach will address all my requirements.

                      Thanks
                      Gary

                      • 8. Re: Notifications
                        objectiser

                        Will let you know Tom........

                        • 9. Re: Notifications
                          objectiser

                          Just started putting together a simple test using the LogicalEPR, by modifying the helloworld example in quickstart, however I get the following compilation problem:

                          [javac] symbol : class eprs
                          [javac] location: package org.jboss.soa.esb.addressing
                          [javac] org.jboss.soa.esb.addressing.eprs.LogicalEPR(message.getHeader().
                          [javac] ^
                          [javac] 1 error

                          Just wondered which jar is it picking up the soa.esb.addressing package from, but not the eprs sub-package?

                          For some earlier standalone client tests I used the jbossesb-rosetta.jar from deploy/jbossesb.sar/lib folder for the jboss.soa.esb classes, which does have the eprs package.

                          I will keep digging - but just in case there is a simple explanation, I thought I would ask.

                          Regards
                          Gary

                          • 10. Re: Notifications
                            marklittle

                            Strange. I build the CP earlier today. Are you running against trunk? Which branch/tag?

                            • 11. Re: Notifications
                              tfennelly

                              All EPR classes are located in jbossesb-rosetta.jar.

                              Perhaps the native-client is a better example for you to base off?? It has a client component (it's a JSR 181 impl) that uses the ServiceInvoker. All client classpaths etc will be in place for you there.

                              • 12. Re: Notifications
                                objectiser

                                Looks like the eprs package is ok - if I change to JMSEpr it compiles fine. So must be some additional dependency on the LogicalEPR class.

                                • 13. Re: Notifications
                                  objectiser

                                  I'm using version 4.2.1GA. I'll have a look at the native-client to see if it has additional local jars.

                                  Thanks
                                  Gary

                                  • 14. Re: Notifications
                                    marklittle

                                    I'll check out the 4.2.1GA branch and check.

                                    1 2 Previous Next