Re: Camel routeTemplate

2021-07-08 Thread Matthias Leinweber
Hello again,

I looked into the source..

What do you think about adding RouteTemplateParameterSource interface to
public class BlueprintPropertiesSource extends ServiceSupport implements
PropertiesSource?

Otherwise I would work with a simple service like
MyRouteTemplateParameterSource implements RouteTemplateParameterSource.

But How can I trigger the reload of a blueprint? The only "hackaround" i
could think of would be something like this
 ?
Or is there a better mechanism to restart a blueprint bundle with an event
e.g. EventAdmin? i only found one point in code where
blueprintContainer.reload(); is called.

What do you think?


BR
Matthias


Am Mi., 7. Juli 2021 um 12:54 Uhr schrieb Matthias Leinweber <
m.leinwe...@datatactics.de>:

> Hello Jb,
>
> i wasn't looking for the basic stuff... I tried this:
> And yes i  configured cm:property-paceholder from osgi config (Which is
> working with reloading) but this here doesn't work
>
> 
>   
> 
> 
> 
> 
>   
>   {{greeting}} ${body}
>   
> 
>   
>
>
> And in spring application.props you can do something like the following
> what i added to the osgi config. Its quite handy when you want to create
> multiple kafka consumer within one context e.g.
>
> camel.route-template[0].template-id=myTemplatecamel.route-template[0].name=Jeancamel.route-template[0].greeting=cheese
> camel.route-template[1].template-id=myTemplatecamel.route-template[1].name=Matthiascamel.route-template[1].greeting=wurst
>
>
> Btw i had an outher Caml regarded question .. injecting karaf JAAS into jetty 
> and kubernetes clustering support.
>
> BR,
>
> Matthias
>
>
> Am Mi., 7. Juli 2021 um 09:26 Uhr schrieb Jean-Baptiste Onofre <
> j...@nanthrax.net>:
>
>> Hi Mathias,
>>
>> Is it what you are looking for:
>> https://github.com/apache/karaf/tree/main/examples/karaf-camel-example/karaf-camel-example-blueprint
>>  ?
>>
>> Regards
>> JB
>>
>> Le 6 juil. 2021 à 21:57, Matthias Leinweber 
>> a écrit :
>>
>>  Hello,
>>
>> i am trying to use routeTemplates within karaf with DSL but i  don't find
>> any examples how to create routes with XML DSL. Also
>> https://camel.apache.org/manual/latest/route-template.html#_creating_routes_from_properties_file
>> seems not wo work in karaf.
>>
>> Any suggestions?
>>
>> br,
>> Matthias
>>
>>
>>
>
> --
>
> Matthias Leinweber
>
> Telefon: +49 176 810 24580
> E-Mail: m.leinwe...@datatactics.de
> Internet: http://www.datatactics.de
>
> datatactics GmbH, Sitz der Gesellschaft: Frankfurt am Main,
> Registergericht: Amtsgericht Frankfurt am Main, HRB 121394, Geschäftsführer
> Matthias Leinweber
>


RE: Shutdown issue ActiveMq

2021-07-08 Thread Jörg Jansen
Good morning JB,

had you already a chance to have a look at the example?

Thanks,
Joerg

-Original Message-
From: Jörg Jansen 
Sent: Montag, 5. Juli 2021 10:47
To: 'user@karaf.apache.org' 
Subject: RE: Shutdown issue ActiveMq

Hi JB,

I just pushed an example to github, which shows the configuration and a 
reproduction guide: https://github.com/jojansen/jms-shutdown.git
Maybe you have time to look into it? 

Regards,
Joerg

-Original Message-
From: Jörg Jansen
Sent: Freitag, 2. Juli 2021 15:02
To: user@karaf.apache.org
Subject: RE: Shutdown issue ActiveMq

Sure, 

the feature looks like: 

jms
spring
activemq-broker-noweb
activemq-client
pax-jms-pool-pooledjms
pax-jms-activemq
camel-jms


  name = lisa-amq
  osgi.jndi.service.name = jms/lisa-amq
  password = ${activemq.jms.password}
  connectionFactoryType = ConnectionFactory
  type = activemq
  url = ${activemq.url}
  user = ${activemq.jms.user}

  # hints for pax-jms-config to use selected 
org.ops4j.pax.jms.service.PooledConnectionFactoryFactory
  pool = pooledjms
  xa = false

  # pooled-jms specific configuration of 
org.messaginghub.pooled.jms.JmsPoolConnectionFactory
  pool.idleTimeout = 10
  pool.maxConnections = 10
  pool.blockIfSessionPoolIsFull = true
  pax.jms.managed = true

  

Thanks and regards
Joerg

-Original Message-
From: Jean-Baptiste Onofre 
Sent: Freitag, 2. Juli 2021 14:53
To: user@karaf.apache.org
Subject: Re: Shutdown issue ActiveMq

It should be fine if your feature installed pax-jms config has prerequisite.

Can you share snippet of your feature referencing activemq-broker ?

Regards
JB

> Le 2 juil. 2021 à 14:21, Jörg Jansen  a 
> écrit :
> 
> It's installed as a prerequisite feature (which is referenced by my 
> customized boot feature). 
> 
> Regards,
> Joerg
> 
> -Original Message-
> From: Jean-Baptiste Onofre 
> Sent: Freitag, 2. Juli 2021 14:07
> To: user@karaf.apache.org
> Subject: Re: Shutdown issue ActiveMq
> 
> Ah the broker is installed as a feature in Karaf ? I thought your broker was 
> outside of Karaf (standalone).
> 
> Does activemq-broker feature installed as boot feature ? Or do you install 
> after startup using feature:install ?
> 
> Regards
> JB
> 
>> Le 2 juil. 2021 à 11:14, Jörg Jansen  a 
>> écrit :
>> 
>> Hi JB,
>> 
>> I'm using the AUTO ack, but switching to CLIENT doesn't make any difference. 
>> How can I change the AMQ pool?
>> From my understanding it should be the preferred way to use pooledjms.
>> 
>> This behavior sounds to me, that it may be be a ordering problem in my 
>> assembly. 
>> The broker should be shutdown after all cliens. 
>> 
>> Regards,
>> Joerg
>> 
>> -Original Message-
>> From: Jean-Baptiste Onofre 
>> Sent: Freitag, 2. Juli 2021 09:52
>> To: user 
>> Subject: Re: Shutdown issue ActiveMq
>> 
>> Hi,
>> 
>> Did you try with another kind of pooler ? Like "native" ActiveMQ pool 
>> instead of wrapped pooledjms ?
>> 
>> What kind of ack do you use in your Camel route ? AUTO (default) or CLIENT ?
>> 
>> Regards
>> JB
>> 
>>> Le 2 juil. 2021 à 08:05, Jörg Jansen  a 
>>> écrit :
>>> 
>>> Hi everybody,
>>> 
>>> I'm facing a problem with our JMS connection, when shutting down the karaf 
>>> container. 
>>> The JMS connectionFactory is provided/configured via ops4j-jms.
>>> When shutting down karaf, I receive the message: "Caught exception trying 
>>> rollback() when putting session back into the pool, will invalidate. 
>>> javax.jms.IllegalStateException: The Session is closed".
>>> 
>>> Does anybody have an idea how to fix it? 
>>> Seaching for a workaround brings up to set the idleTimeout to 0, but this 
>>> has no effect. 
>>> 
>>> The currently used versions are: 
>>> Karaf: 4.3.2
>>> ActiveMq: 5.16.0
>>> Camel: 3.7.4
>>> 
>>> Any help would be really appreciated.
>>> 
>>> Additional details are available below.
>>> 
>>> Thanks in advance,
>>> Joerg
>>> 
>>> 
>>> 
>>> Stacktrace
>>> 
>>> 2021-07-02T07:46:30,260 | WARN  | Camel (gs-os-connector) thread #22 - 
>>> JmsConsumer[AMQ.GSLISA.OS.BUFFERED-SPX] | JmsPoolSession   
>>> | 213 - org.messaginghub.pooled.jms - 1.2.1 | Caught exception trying 
>>> rollback() when putting session back into the pool, will invalidate. 
>>> javax.jms.IllegalStateException: The Session is closed
>>> javax.jms.IllegalStateException: The Session is closed
>>> at 
>>> org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:772) 
>>> ~[?:?]
>>> at 
>>> org.apache.activemq.ActiveMQSession.rollback(ActiveMQSession.java:597) 
>>> ~[?:?]
>>> at 
>>> org.messaginghub.pooled.jms.JmsPoolSession.close(JmsPoolSession.java:112) 
>>> [!/:?]
>>> at 
>>> org.springframework.jms.support.JmsUtils.closeSession(JmsUtils.java:109) 
>>> [!/:?]
>>> at 
>>> 

Re: Strange NoClassDefFoundError in VaadinServletService

2021-07-08 Thread Richard Hierlmeier
Hi JB,

are you finished with your tests on the Azure machine? Can I turn it off?

Regards

  Richard

Am Di., 29. Juni 2021 um 08:49 Uhr schrieb Richard Hierlmeier <
rhierlme...@googlemail.com>:

> No, I am not on Slack.
>
> Richard
>
> Am Mo., 28. Juni 2021 um 16:24 Uhr schrieb Jean-Baptiste Onofre <
> j...@nanthrax.net>:
>
>> Hi,
>>
>> Not yet, just "back in the business" after most of the relocation (still
>> in the middle of the boxes).
>>
>> I will check later tonight or tomorrow.
>>
>> By the way, are you on Slack if I have questions or so ?
>>
>> Regards
>> JB
>>
>> Le 28 juin 2021 à 16:03, Richard Hierlmeier 
>> a écrit :
>>
>> Hi JB,
>>
>> any news from this issue?
>>
>> Richard
>>
>> Am Mo., 21. Juni 2021 um 08:26 Uhr schrieb Richard Hierlmeier <
>> rhierlme...@googlemail.com>:
>>
>>> Hi JB,
>>>
>>> no problem. I am preparing the instance in the cloud.
>>> I will send you the connection details in a private message.
>>>
>>> Thank you
>>>
>>>   Richard
>>>
>>> Am Mo., 21. Juni 2021 um 07:58 Uhr schrieb JB Onofré :
>>>
 Hi Richard

 I don’t have time before Wednesday this week (off today and tomorrow
 for relocation).

 I will try to take a look on Wednesday.

 Regards
 JB

 Le 21 juin 2021 à 07:53, Richard Hierlmeier 
 a écrit :

 
 I upgraded meanwhile to Karaf 4.3.2, but the problem is still present.

 vaadin-server bundle has no dynamic imports. I can see the import in
 the vaadin-server bundle:

 karaf@root()> la -u | grep vaadin-server
 148 | Active   |  80 | 8.13.0  |
 mvn:com.vaadin/vaadin-server/8.13.0

 karaf@root()> headers 148
 ...
 Import-Package =
 ...
 org.atmosphere.cpr;resolution:=optional;version=2.4.30.vaadin3,
 ...

 I have the following feature dependencies:
 vaadin<- ONE <- TWO

 karaf@root()> shutdown
 > bin/karaf.bat clean
 kara@root()> feature:repo-add ...
 karaf@root()> feature:install TWO

 > grep vaadin-server data/log/karaf.log
 2021-06-21T07:23:43,335 | INFO  | features-3-thread-1 |
 FeaturesServiceImpl  | 18 - org.apache.karaf.features.core -
 4.3.2 |   mvn:com.vaadin/vaadin-server/8.13.0
 2021-06-21T07:23:44,075 | INFO  | features-3-thread-1 |
 FeaturesServiceImpl  | 18 - org.apache.karaf.features.core -
 4.3.2 |   mvn:com.vaadin/vaadin-server/8.13.0

 In this constellation I get now the NoClassDefFoundError when accessing
 the Vaadin UI.

 karaf@root()> shutdown
 > bin/karaf.bat clean
 karaf@root()> feature:repo-add ...
 karaf@root()> feature:install ONE

 > grep vaadin-server data/log/karaf.log
 2021-06-21T07:28:53,691 | INFO  | features-3-thread-1 |
 FeaturesServiceImpl  | 18 - org.apache.karaf.features.core -
 4.3.2 |   mvn:com.vaadin/vaadin-server/8.13.0
 2021-06-21T07:28:54,230 | INFO  | features-3-thread-1 |
 FeaturesServiceImpl  | 18 - org.apache.karaf.features.core -
 4.3.2 |   mvn:com.vaadin/vaadin-server/8.13.0

 Now I can access the Vaadin UI.

 kara@root()>  feature:install TWO

 Vaadin UI is still working.

 Are you interested in analyzing this problem? I can provide an instance
 in a public cloud.

 Regards

   Richard








 Am Sa., 19. Juni 2021 um 06:39 Uhr schrieb Jean-Baptiste Onofre <
 j...@nanthrax.net>:

> Hi Richard,
>
> Did you see a refresh when you install feature TWO ?
>
> Do you see org.atmosphere.cpr import in vaadin server bundle or is it
> a dynamic import ?
>
> Regards
> JB
>
> Le 18 juin 2021 à 18:21, Richard Hierlmeier <
> rhierlme...@googlemail.com> a écrit :
>
>
> I have a strange error in a Vaadin application running in Karaf 4.3.1.
> I have two features, that use Vaadin. Feature ONE works fine. When feature
> TWO is deployed I get the following error when accessing the Vaadin UI:
>
> java.lang.NoClassDefFoundError: org/atmosphere/cpr/AtmosphereHandler
> at
> com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:68)
> at com.vaadin.server.VaadinService.init(VaadinService.java:219)
> at
> com.vaadin.server.VaadinServlet.createServletService(VaadinServlet.java:380)
> at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:210)
> at de.hierlmeier.karaf.vaadinsample.UIServlet.init(UIServlet.java:44)
> at
> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:624)
> at
> org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:478)
> at
> org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:751)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at