Hi.
We are about to migrate from M4 to RC2. Where did @Publisher go? Whats the new pattern to do this?
/Magnus
Hi.
We are about to migrate from M4 to RC2. Where did @Publisher go? Whats the new pattern to do this?
/Magnus
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
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Code looks like this:
Whenever a event is persisted, it's sent to all subscribers, and they act upon the type of event...Code:@Transactional(propagation = Propagation.REQUIRES_NEW) @Publisher(channel="jobEventChannel") public JobEvent addEvent(final JobEvent event) { this.entityManager.persist(event); return event; }
So the recommended way to send messages now is using the new template?
/Magnus
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.
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf