-
1. Re: Re-using jgroups channel managed from domain.xml
kristjan273 Dec 1, 2011 10:29 AM (in response to kristjan273)By reading some more on topic I demistified this. It is shared transport introduced by jgroups and as can be seen from https://issues.jboss.org/browse/AS7-1768 the default singleton_name is 'udp'
-
2. Re: Re-using jgroups channel managed from domain.xml
kristjan273 Dec 5, 2011 9:23 AM (in response to kristjan273)I marked this discussion 'assumed answered', but digging further I would ask for some additional help. I see in https://issues.jboss.org/browse/AS7-541 that some channel factory exists. I have studied source from as clustering portion (specially how infinispan reuse the channel), but still don't see the way developer can use msc service inside the code.
Now question, is this service meant to be accessible from developer's point of view and how?
I think I would like to achieve that container creates and manages the jgroups channel for me and/or reuse the existing one (if possible). Can someone provide some example code for this case and/or hint if this is proper usage. Otherwise I will hold on the current implementation of my project where I create custom jgroups channel from code and maintain it.
tnx in advance
-
3. Re: Re-using jgroups channel managed from domain.xml
kristjan273 Dec 6, 2011 7:13 AM (in response to kristjan273)Ok, tried some more, googled for MSC injection (is there any doc/example on that?) ,checked the src from jboss-as-clustering-infinispan to see, how infinispan module does that (but is so far little to advanced code).
I have tried following
@PostConstruct private void start() { InjectedValue<ChannelFactory> channelFactory = new InjectedValue<ChannelFactory>(); ChannelFactory value = channelFactory.getValue(); try { createChannel = value.createChannel("udp"); createChannel.connect("sysMsgs"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
but getting the following error:
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
(See attachment for more log)
I didn't know that service for
ChannelFactory
and concept of reusing transport stack was already introduced in jboss5 (http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/clustering-blocks.chapt.html#clustering-blocks-jgroups-channelfactory). I would really go for the accessible service, just wonder how to get it from as7.Anyone?
-
server.log.zip 1.1 KB
-
-
4. Re: Re-using jgroups channel managed from domain.xml
alesj Dec 6, 2011 10:28 AM (in response to kristjan273)What exactly are you trying to do?
Adding external services can be done via POJO subsystem.
Otherwise you need to impl your own subsystem and "hardcode" the services.
(or you can modify some existing subsystem)
If you're around, we can discuss this here:
* http://pot.kiberpipa.org/super-fast-java-development-with-jbossas7-ales-justin-tomaz-cerar/
-
5. Re: Re-using jgroups channel managed from domain.xml
kristjan273 Dec 14, 2011 8:23 AM (in response to alesj)Tnx Aleš for invitation, been there, clarified on this.
Tomaž said what's the big idea to use jgroups channel directly if on top of it Infinispan is production ready.
I have rethinked quickly and actually can confirm that all (three) cases where our app used jchannel directly is able to be switched to infinispan clustered object.