Announcement Announcement Module
Collapse
No announcement yet.
@Publisher? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Publisher?

    Hi.

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

    /Magnus

  • #2
    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

    Comment


    • #3
      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

      Comment


      • #4
        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.

        Comment

        Working...
        X