RE: Camel plugin no longer shows up in hawtio
Hi. Maybe it is the same problem that I've had once? https://camel.465427.n5.nabble.com/Debugging-and-tracing-camel-3-0-0-on-OSGi-td5849514.html Best regards, Konstantin J. Chernov. -Original Message- From: Mark Nuttall Sent: Friday, June 5, 2020 8:37 AM To: users@camel.apache.org Subject: Re: Camel plugin no longer shows up in hawtio Might be a version issue. I had the same problem and that is what it was. Also, debugging is not there unless I drop back camel versions. On Thu, Jun 4, 2020, 7:38 PM Jeremy Ross wrote: > Hey camel folks, > > At some point the Camel plugin stopped showing up in hawtio. I can > access hawtio just fine, but Camel is not in the menu navigation. I > don't recall seeing anything in the upgrade guides about it. Did I miss > something? > > Thanks, > > Jeremy >
RE: Stub component usage patterns
Hi. For example, imagine a route which is doing some work and sending the message to jms:queue:... More than that, it's packaged as an OSGi bundle which is only accepting some external configuration from Configuration Admin. And you need to write an integration test. Then you would need a JMS broker. But stub endpoint allows you to run an integration test without it. Something like: to((destStubEnabled ? "stub:" : "") + "jms:queue:" + jmsQueue + "?connectionFactory=#jms") Also you can stub your input as well, using some other boolean switch in the configuration. And in the test, you can reference the bundle's CamelContext inside the container (karaf), and send/receive messages to/from stub endpoints. We are using a following model: 1. Unit tests are written to verify the business logic (POJOs) 2. Integration tests are written to verify the combination of business logic + transport logic (Camel) inside the container Karaf, but without having anything outside the container 3. Acceptance tests are written to verify the same, but with real components outside of the container Best regards, Konstantin Chernov. -Original Message- From: Jeremy Ross Sent: Tuesday, January 14, 2020 10:55 AM To: users@camel.apache.org Subject: Stub component usage patterns Hi all, I'm not sure I understand how the Stub component is intended to be used. The canonical example seems to be a JMS consumer in production. Camel in Action says "stub any Camel endpoint by prefixing the endpoint with stub:". Cool, well if I'm testing production routes, I don't want to modify them, so would it make sense to use replaceFromWith() to replace the JMS consumer with a stub? How would this be better than just replacing the JMS consumer with a direct or vm? Does stub offer some other benefit? Thanks for any ideas or suggestions. Jeremy
RE: JMS connection pooling configuration instance wide in Camel 3.0.0 (Karaf 4.2.7)
Hi. That's how I did it (with artemis, though I suppose it would be the same with the activemq): feature:repo-add mvn:org.apache.activemq/artemis-features/2.10.1/xml/features feature:install -u -r pax-jms-artemis pax-jms-pool pax-jms-config jms Then create a etc/org.ops4j.connectionfactory-default.cfg (default is the "name" of the instance), changing the parameters as you need: connectionFactoryType = ConnectionFactory jms.url = tcp://localhost:61616 jms.user = karaf jms.password = karaf osgi.jndi.service.name = mq/default type = artemis Later on, you can reference the ConnectionFactory in blueprint xml: But if you want to expose a org.apache.activemq.ActiveMQConnectionFactory, from my point of view there's two options: 1. Register it using the blueprint as a service and reference it in other blueprints/bundles/... 2. Create a bundle, that registers a ManagedServiceFactory/ManagedService, which will create and register an instance of ActiveMQConnectionFactory with the parameters from the Configuration Admin (that come from the cfg file). -Original Message- From: Gerald Kallas Sent: Monday, January 6, 2020 3:24 PM To: users@camel.apache.org Subject: JMS connection pooling configuration instance wide in Camel 3.0.0 (Karaf 4.2.7) Dear community, I'm currently configuring the JMS connection factory within a blueprint XML like Could this be done in one of the config files in etc folder for the whole instance of Karaf/Camel? Any hints are helpful, tx in advance. Best - Gerald
sjms2 + OSGi ConnectionFactory
Hi! On camel-3.0.0 + karaf 4.2.7 + artemis 2.10.1 JMS ConnectionFactory is registered as a service (javax.jms.ConnectionFactory) without pooling and passed as a blueprint proxy into the sjms2 component. XML: http://www.osgi.org/xmlns/blueprint/v1.0.0;> http://camel.apache.org/schema/blueprint;> Hello, world And everything is fine, until the ConnectionFactory is unregistered and registered again (due to configuration change, for example). After that, following exception is thrown: 19:03:42.372 WARN [Camel (camel-47) thread #185 - timer://example] Error processing exchange. Exchange[ID-KJCHERNOV-WIN-1576168069058-51-2]. Caused by: [org.apache.camel.CamelExchangeException - Unable to complete sending the JMS message. Exchange[ID-KJCHERNOV-WIN-1576168069058-51-2]. Caused by: [javax.jms.IllegalStateException - Session is closed]] org.apache.camel.CamelExchangeException: Unable to complete sending the JMS message. Exchange[ID-KJCHERNOV-WIN-1576168069058-51-2]. Caused by: [javax.jms.IllegalStateException - Session is closed] at org.apache.camel.component.sjms.producer.InOnlyProducer.sendMessage(InOnlyPr oducer.java:53) ~[!/:3.0.0] at org.apache.camel.component.sjms.SjmsProducer.process(SjmsProducer.java:261) ~[!/:3.0.0] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:134) ~[!/:3.0.0] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliverySta te.run(RedeliveryErrorHandler.java:476) ~[!/:3.0.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(Default ReactiveExecutor.java:185) [!/:3.0.0] at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultRea ctiveExecutor.java:59) [!/:3.0.0] at org.apache.camel.processor.Pipeline.process(Pipeline.java:87) [!/:3.0.0] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProce ssor.java:228) [!/:3.0.0] at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsum er.java:193) [!/:3.0.0] at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:75) [!/:3.0.0] at java.util.TimerThread.mainLoop(Timer.java:556) [?:?] at java.util.TimerThread.run(Timer.java:506) [?:?] Caused by: javax.jms.IllegalStateException: Session is closed at org.apache.activemq.artemis.jms.client.ActiveMQSession.checkClosed(ActiveMQS ession.java:1251) ~[!/:?] at org.apache.activemq.artemis.jms.client.ActiveMQSession.createTextMessage(Act iveMQSession.java:233) ~[!/:?] at org.apache.camel.component.sjms.jms.JmsBinding.createJmsMessageForType(JmsBi nding.java:530) ~[!/:3.0.0] at org.apache.camel.component.sjms.jms.JmsBinding.createJmsMessage(JmsBinding.j ava:470) ~[!/:3.0.0] at org.apache.camel.component.sjms.jms.JmsBinding.makeJmsMessage(JmsBinding.jav a:285) ~[!/:3.0.0] at org.apache.camel.component.sjms.jms.JmsBinding.makeJmsMessage(JmsBinding.jav a:226) ~[!/:3.0.0] at org.apache.camel.component.sjms.producer.InOnlyProducer.sendMessage(InOnlyPr oducer.java:50) ~[!/:3.0.0] ... 11 more And it will never recover until restart of a bundle, as it caches the Session object. Is there anything I can do about it? P.S.> camel-jms does not handle this either, though it's complaining about closed service locator, which was probably garbage collected. Thanks in advance, Konstantin J. Chernov.
RE: Debugging and tracing camel-3.0.0 on OSGi
Hi, Looks like setting backlogTracing on context only turns on the tracing possibility. Shouldn't there be another option backlogDebugging=true|false ? Konstantin Chernov. -Original Message- From: k.j.cher...@gmail.com Sent: Monday, December 2, 2019 10:13 PM To: users@camel.apache.org Subject: RE: Debugging and tracing camel-3.0.0 on OSGi Thanks! https://issues.apache.org/jira/browse/CAMEL-14240 Konstantin Chernov. -Original Message- From: Claus Ibsen Sent: Monday, December 2, 2019 10:01 PM To: users@camel.apache.org Subject: Re: Debugging and tracing camel-3.0.0 on OSGi Hi Yeah you are welcome to create a JIRA to add backlogTracing=true|false to spring and blueprint xml On Mon, Dec 2, 2019 at 3:34 PM wrote: > > Hi. > > Thank you very much, I managed to turn the debugger on using: > > public class DebuggerEnablerBean { > public DebuggerEnablerBean(CamelContext camelContext) { > camelContext.setDebugging(true); > } > } > > and instantiating this bean in xml: > > > > > and it even works now in hawtio! > > But is there any way to do this directly from blueprint xml, without using > java? The way I did it looks like a very dirty hack for me. > Maybe there should be an option like "trace=true" (say, "debug=true") on > camelContext? > > > Konstantin Chernov. > > -Original Message- > From: Claus Ibsen > Sent: Monday, December 2, 2019 9:13 PM > To: users@camel.apache.org > Subject: Re: Debugging and tracing camel-3.0.0 on OSGi > > I logged a ticket about the missing XSDs > https://issues.apache.org/jira/browse/CAMEL-14239 > > On Mon, Dec 2, 2019 at 3:07 PM Claus Ibsen wrote: > > > > Hi > > > > You need to turn on tracing before starting Camel in Camel 3 to have JMX > > tracer. > > > > context.setBacklogTracing(true); > > > > > > And the poor mans debugger is a feature we no longer want to provide > > out of the box in Camel and its removed. > > > > > > > > On Mon, Dec 2, 2019 at 2:49 PM wrote: > > > > > > Hello. > > > > > > Is there any way to trace or debug the camel routes in 3.0.0 when > > > starting camel context through OSGi Blueprint? > > > I tried looking for BacklogDebugger/BacklogTracer MBeans on JMX without > > > any luck (though I can see the context/processor/routes there). > > > Debug/trace tabs just gone missing from my hawtio console after > > > update from 2.24. I only managed to find an issue > > > https://issues.apache.org/jira/browse/CAMEL-13759 > > > stating that "There is already the newer backlog debugger that hawtio and > > > other tools uses for debugging.", so I believe there must be a way to > > > make it work somehow. > > > Setting trace=true on camelContext only creates a DefaultTracer, which > > > does not seem to be reporting any notifications through JMX. > > > > > > Using Java 11 + Karaf 4.2.7 + Hawtio 2.8.0 + Camel 3.0.0. > > > > > > P.S.> It looks like the blueprint xsd for 3.0.0 is missing from the > > > http://camel.apache.org/schema/blueprint/ at all. Is there any other > > > place where the schemas reside (besides the camel-blueprint jar)? > > > > > > Thanks in advance, > > > Konstantin Chernov. > > > > > > > > > > > > -- > > Claus Ibsen > > - > > http://davsclaus.com @davsclaus > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > -- > Claus Ibsen > - > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 > -- Claus Ibsen - http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
RE: Debugging and tracing camel-3.0.0 on OSGi
Thanks! https://issues.apache.org/jira/browse/CAMEL-14240 Konstantin Chernov. -Original Message- From: Claus Ibsen Sent: Monday, December 2, 2019 10:01 PM To: users@camel.apache.org Subject: Re: Debugging and tracing camel-3.0.0 on OSGi Hi Yeah you are welcome to create a JIRA to add backlogTracing=true|false to spring and blueprint xml On Mon, Dec 2, 2019 at 3:34 PM wrote: > > Hi. > > Thank you very much, I managed to turn the debugger on using: > > public class DebuggerEnablerBean { > public DebuggerEnablerBean(CamelContext camelContext) { > camelContext.setDebugging(true); > } > } > > and instantiating this bean in xml: > > > > > and it even works now in hawtio! > > But is there any way to do this directly from blueprint xml, without using > java? The way I did it looks like a very dirty hack for me. > Maybe there should be an option like "trace=true" (say, "debug=true") on > camelContext? > > > Konstantin Chernov. > > -Original Message- > From: Claus Ibsen > Sent: Monday, December 2, 2019 9:13 PM > To: users@camel.apache.org > Subject: Re: Debugging and tracing camel-3.0.0 on OSGi > > I logged a ticket about the missing XSDs > https://issues.apache.org/jira/browse/CAMEL-14239 > > On Mon, Dec 2, 2019 at 3:07 PM Claus Ibsen wrote: > > > > Hi > > > > You need to turn on tracing before starting Camel in Camel 3 to have JMX > > tracer. > > > > context.setBacklogTracing(true); > > > > > > And the poor mans debugger is a feature we no longer want to provide > > out of the box in Camel and its removed. > > > > > > > > On Mon, Dec 2, 2019 at 2:49 PM wrote: > > > > > > Hello. > > > > > > Is there any way to trace or debug the camel routes in 3.0.0 when > > > starting camel context through OSGi Blueprint? > > > I tried looking for BacklogDebugger/BacklogTracer MBeans on JMX without > > > any luck (though I can see the context/processor/routes there). > > > Debug/trace tabs just gone missing from my hawtio console after > > > update from 2.24. I only managed to find an issue > > > https://issues.apache.org/jira/browse/CAMEL-13759 > > > stating that "There is already the newer backlog debugger that hawtio and > > > other tools uses for debugging.", so I believe there must be a way to > > > make it work somehow. > > > Setting trace=true on camelContext only creates a DefaultTracer, which > > > does not seem to be reporting any notifications through JMX. > > > > > > Using Java 11 + Karaf 4.2.7 + Hawtio 2.8.0 + Camel 3.0.0. > > > > > > P.S.> It looks like the blueprint xsd for 3.0.0 is missing from the > > > http://camel.apache.org/schema/blueprint/ at all. Is there any other > > > place where the schemas reside (besides the camel-blueprint jar)? > > > > > > Thanks in advance, > > > Konstantin Chernov. > > > > > > > > > > > > -- > > Claus Ibsen > > - > > http://davsclaus.com @davsclaus > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > -- > Claus Ibsen > - > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 > -- Claus Ibsen - http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
RE: Debugging and tracing camel-3.0.0 on OSGi
Hi. Thank you very much, I managed to turn the debugger on using: public class DebuggerEnablerBean { public DebuggerEnablerBean(CamelContext camelContext) { camelContext.setDebugging(true); } } and instantiating this bean in xml: and it even works now in hawtio! But is there any way to do this directly from blueprint xml, without using java? The way I did it looks like a very dirty hack for me. Maybe there should be an option like "trace=true" (say, "debug=true") on camelContext? Konstantin Chernov. -Original Message- From: Claus Ibsen Sent: Monday, December 2, 2019 9:13 PM To: users@camel.apache.org Subject: Re: Debugging and tracing camel-3.0.0 on OSGi I logged a ticket about the missing XSDs https://issues.apache.org/jira/browse/CAMEL-14239 On Mon, Dec 2, 2019 at 3:07 PM Claus Ibsen wrote: > > Hi > > You need to turn on tracing before starting Camel in Camel 3 to have JMX > tracer. > > context.setBacklogTracing(true); > > > And the poor mans debugger is a feature we no longer want to provide > out of the box in Camel and its removed. > > > > On Mon, Dec 2, 2019 at 2:49 PM wrote: > > > > Hello. > > > > Is there any way to trace or debug the camel routes in 3.0.0 when starting > > camel context through OSGi Blueprint? > > I tried looking for BacklogDebugger/BacklogTracer MBeans on JMX without any > > luck (though I can see the context/processor/routes there). > > Debug/trace tabs just gone missing from my hawtio console after > > update from 2.24. I only managed to find an issue > > https://issues.apache.org/jira/browse/CAMEL-13759 > > stating that "There is already the newer backlog debugger that hawtio and > > other tools uses for debugging.", so I believe there must be a way to make > > it work somehow. > > Setting trace=true on camelContext only creates a DefaultTracer, which does > > not seem to be reporting any notifications through JMX. > > > > Using Java 11 + Karaf 4.2.7 + Hawtio 2.8.0 + Camel 3.0.0. > > > > P.S.> It looks like the blueprint xsd for 3.0.0 is missing from the > > http://camel.apache.org/schema/blueprint/ at all. Is there any other place > > where the schemas reside (besides the camel-blueprint jar)? > > > > Thanks in advance, > > Konstantin Chernov. > > > > > > > -- > Claus Ibsen > - > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen - http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
Debugging and tracing camel-3.0.0 on OSGi
Hello. Is there any way to trace or debug the camel routes in 3.0.0 when starting camel context through OSGi Blueprint? I tried looking for BacklogDebugger/BacklogTracer MBeans on JMX without any luck (though I can see the context/processor/routes there). Debug/trace tabs just gone missing from my hawtio console after update from 2.24. I only managed to find an issue https://issues.apache.org/jira/browse/CAMEL-13759 stating that "There is already the newer backlog debugger that hawtio and other tools uses for debugging.", so I believe there must be a way to make it work somehow. Setting trace=true on camelContext only creates a DefaultTracer, which does not seem to be reporting any notifications through JMX. Using Java 11 + Karaf 4.2.7 + Hawtio 2.8.0 + Camel 3.0.0. P.S.> It looks like the blueprint xsd for 3.0.0 is missing from the http://camel.apache.org/schema/blueprint/ at all. Is there any other place where the schemas reside (besides the camel-blueprint jar)? Thanks in advance, Konstantin Chernov.