Results 1 to 4 of 4

Thread: @Publisher?

  1. #1
    Join Date
    Feb 2005
    Posts
    47

    Default @Publisher?

    Hi.

    We are about to migrate from M4 to RC2. Where did @Publisher go? Whats the new pattern to do this?

    /Magnus

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    We moved the AOP interceptor-based publishing code to the sandbox for now. The main reason is that we are reconsidering exactly how to configure the options for what will be sent in the Message. Specifically, we didn't want to lock something in now that may not be accommodating for the EL support that we'll be adding post 1.0. The idea then was to hold this feature back until we add that support as well. Interestingly, you are the first person to notice its absence, so I guess it was not very widely used.

    Additionally, it seemed that some people were using @Publisher where a GatewayProxyFactoryBean or inbound Channel Adapter would have been more appropriated.

    Are you using this as an AOP interceptor-based approach? Can you briefly describe the use-case?

    Regards,
    Mark

  3. #3
    Join Date
    Feb 2005
    Posts
    47

    Default

    Quote Originally Posted by Mark Fisher View Post
    Are you using this as an AOP interceptor-based approach? Can you briefly describe the use-case?
    Code looks like this:

    Code:
        @Transactional(propagation = Propagation.REQUIRES_NEW)
        @Publisher(channel="jobEventChannel")
        public JobEvent addEvent(final JobEvent event) {
            this.entityManager.persist(event);
            return event;
        }
    Whenever a event is persisted, it's sent to all subscribers, and they act upon the type of event...

    So the recommended way to send messages now is using the new template?

    /Magnus

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Well, you could of course inject the channel and/or create a MessageChannelTemplate instance in that class. However, that would not be ideal from the perspective of non-invasiveness.

    At the very least, I would probably create an AOP interceptor anyways... and you can check out the code that is now in the sandbox. When we add this official support, you could then update the code to accommodate any changes.

    As I mentioned, I am now expecting this to be part of 1.1 - only because we need to consider the impact of some other things we'll be adding then.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •