HornetQ 2.3 integration in AS7
jmesnil Oct 1, 2012 5:55 AMHi,
I am looking at the PR to integrate HornetQ 2.3 into AS7[1]
I have rebased Andy's commits to be up to date with AS7 master branch (I refactored the xml code to split the XML marshaller from the XML parsers).
I have reviewed Howard's commit to add JGroups support to HornetQ but his commit can not be applied automatically. I can patch it manually either since the commit references changes he made to HornetQ that has not landed in master branch yet.
Looking at it more carefully, I found some issues that would need to be resolved to ease up the integration:
* broadcast group API.
the API is split between many too packages:
* BroadcastGroupConfiguration in org.hornetq.core.config
* BroadcastEndpointFactoryConfiguration in org.hornetq.api.core
* BroadcastEndpointFactory in org.hornetq.core.cluster
I think we should refactor the API to have it stand alone in a single package
* JGroups support
HornetQ defines a JGroupsBroadcastGroupConfigurationWithFile which takes a JGroups file and extends AbstractJGroupsBroadcastEndpoint. This class depends on org.jgroups package => HornetQ requires JGroups to be compiled
However, JGroupsFileEndpointFactory loads JGroupsBroadcastEndpointWithFile through reflection to avoid compilation errors. I don't understand the reason, the module still requires JGroups to compile JGroupsBroadcastGroupConfigurationWithFile.
HornetQ defines a JGroupsBroadcastEndpointWithFile with takes a JGroups file. AS7 will be able to get a reference on a JGroups channel object directly. I think the JGroupsBroadcastEndpointWithFile class should have 2 constructors: 1 taking a fileName String and creating the JChannel, the other one taking directly a JChannel. AS7 would use this 2nd constructor.
* AS7 attributes removal
the preferred way to configure broadcast-group is to use socket-binding. However, AS7 for compatibility purposes, still allow to set the group-address and port directly without going through a socket-binding. We can deprecate theses attributes (ie warn the user that the is a better way to do it) but we can not remove them.
This means that the code to parse XML, setup the broadcast group must handle 3 cases:
* broadcast group configured with socket-binding
* broadcast group configured with jgroups channel
* broadcast group configured with group-address & port (deprecated but still valid)