-
1. Re: SwitchYard bean service lifecycle handlers
kcbabo Jul 1, 2013 11:02 AM (in response to synclpz)Gateways expose a user-managed lifecycle in SwitchYard, implementation components do not. For this use case, I would create a Camel component and then configure it via it's URI. There will be documentation on how to add extension Camel components in the 1.0 docset.
-
2. Re: SwitchYard bean service lifecycle handlers
synclpz Jul 1, 2013 12:53 PM (in response to kcbabo)It's a pity that components cannot react to lifecycle state change. Do you intentionally not incorporating this functionality into SY?
Concerning Camel - I'm not (yet) familiar with that technology, but I'll try
Can you point me to the right place to start with gateway and it's lifecycle implementation? Some docs/source/package maybe?
At the moment I given up with putting custom xml-file to classpath and parsing config in in @PostConstruct bean method, then free all resources in @PreDestroy one. I think it should also work...
PS: When do you suppose to release SY1.0?
-
3. Re: SwitchYard bean service lifecycle handlers
synclpz Jul 1, 2013 1:42 PM (in response to synclpz)Addition to this:
At the moment I given up with putting custom xml-file to classpath and parsing config in in @PostConstruct bean method, then free all resources in @PreDestroy one. I think it should also work...
@PreDestroy is never called. So, really no way to tear down communication channels and stop threads.
-
4. Re: SwitchYard bean service lifecycle handlers
kcbabo Jul 1, 2013 3:44 PM (in response to synclpz)SwitchYard 1.0 will be released this month.
@PreDestroy is invoked as part of the lifecycle of a managed bean by CDI, so if @PreDestroy is not being called it may ben an issue with
I would not implement a gateway to external systems using an implementation in SwitchYard, that's the role of gateways and there are many bits of plumbing specifically designed for that (lifecycle, configuration, etc.). I believe you will find that Camel components are extremely easy to develop and integrate within SwitchYard, particularly when the 1.0 docs are complete. :-)
-
5. Re: SwitchYard bean service lifecycle handlers
synclpz Jul 2, 2013 4:54 AM (in response to kcbabo)Thanx much.
Is 1.0.0-SNAPSHOT stable enough to experiment with at the moment? I do ask only because it's much difficult to try to learn some new piece of SW with it's own complicated bugs :-)
Is it master branch on github to checkout 1.0 sources?
@PreDestroy is invoked as part of the lifecycle of a managed bean by CDI, so if @PreDestroy is not being called it may ben an issue with
Didn't get it, sorry. You meant "an issue with" what?
I would not implement a gateway to external systems using an implementation in SwitchYard, that's the role of gateways and there are many bits of plumbing specifically designed for that (lifecycle, configuration, etc.). I believe you will find that Camel components are extremely easy to develop and integrate within SwitchYard, particularly when the 1.0 docs are complete. :-)
Ok, can you point me to some general steps to implement and (especially) enable for switchyard to use some custom gateway (component?), like, maybe yours 'http' or camels 'mail'. May be there are some draft docs somewhere?
I'll try to check some current component's implementations out...
-
6. Re: SwitchYard bean service lifecycle handlers
kcbabo Jul 2, 2013 9:43 PM (in response to synclpz)My comment got clipped on the @PreDestroy answer - sorry about that. If @PreDestroy is not being invoked then it's likely an issue with DeltaSpike integration, since SwitchYard does not invoke those methods directly. We merely integrate with DeltaSpike via a CDI Extension. Please file a JIRA with an example app demonstrating the problem so that we can dig deeper.
-
7. Re: SwitchYard bean service lifecycle handlers
kcbabo Jul 2, 2013 9:45 PM (in response to kcbabo)1.0 will be out very soon and the component extension mechanism will be documented at that point. I don't think it will be much help, but this was the JIRA for allowing Camel component extensions:
-
8. Re: SwitchYard bean service lifecycle handlers
synclpz Jul 3, 2013 5:24 AM (in response to kcbabo)Thanks for the answers. As I see in SWITCHYARD-1481, there is no plan to implement configuration via switchyard.xml configs, only by URI parameters. At least that was helpful. I'm trying to implement camel-producer at the moment. For SY0.8, I see, I should add some code to switchyard-components (like switchyard-camel-mail) to enable the use of my gateway, and then add jboss-deployment-structure dependencies on my camel-gateway, right? Would it be enough for SY to onboard my gateway?