OSGI - org.jpos.q2.autostart - where to configure and the default setting?

43 views
Skip to first unread message

Mark Salter

unread,
May 9, 2017, 5:35:57 AM5/9/17
to jPOS Users
Good morning.

This is a novelty :-) - let's hope it is a #smartquestion!

We were just trying out OSGI and are trying to deploy q2 as a package under OSGI.

Currently the following if condition is not satisfied :-

if ("true".equalsIgnoreCase(context.getProperty("org.jpos.q2.autostart")))
            (q2 = new Q2(new String[] {}, context)).start();


So the q2 is not .started.

Where should we be setting this property, so that it is?

Also can someone (Victor?) please describe the scenario where you would want q2 to autostart, how you would then 'manually' start it?

I wonder if I might also ask after the default processing and perhaps ask if we might legitamatly autostart q2 as a default and reverse the logic to...


if ("false".equalsIgnoreCase(context.getProperty("org.jpos.q2.autostart"))) {
         // don't start q2
   } else {
           // true or not set...
          (q2 = new Q2(new String[] {}, context)).start();
   }


--
Mark

Alejandro Revilla

unread,
May 9, 2017, 10:28:12 AM5/9/17
to jPOS Users

First of all, I’m glad to see you’re deploying under OSGi, wonder if that’s under CICS/Liberty?

We initially auto-started Q2, but then if I recall correctly Victor was trying it under Karaf and loading other modules so we changed it not start by default.

You can set that bundle-property in many ways:

  • You can add it to your MANIFEST.MF file (Bundle-Properties: org.jpos.q2.autostart=true)
  • You can use your OSGi framework management console to add the property
  • You can use a system property (-Dorg.jpos.q2.autostart=true when you start your JVM)
  • You can use your OSGi framework to start jPOS’ bundle

The thing is you usually don’t just use a stand-alone jPOS, you probably have your own application that needs jPOS, so jPOS gets loaded and available, but not started until your own application (coming in another OSGi bundle) starts it.





--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/28288188-58e4-4bf6-8fbd-dc4a9dfe325a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Salter

unread,
May 10, 2017, 7:57:32 AM5/10/17
to jPOS Users


On Tuesday, May 9, 2017 at 3:28:12 PM UTC+1, Alejandro Revilla wrote:

First of all, I’m glad to see you’re deploying under OSGi, wonder if that’s

We are taking a look having observed some of the benefits.

under CICS/Liberty?

Yes / perhaps.

We initially auto-started Q2, but then if I recall correctly Victor was trying it under Karaf and loading other modules so we changed it not start by default.

Understood, I suspected there was some evolution - as a previous look I had seen the autostart happen, so was sad to find it didn't happen this try - it wasn't obvious why.

You can set that bundle-property in many ways:

Thanks, nice to have these listed...
  • You can add it to your MANIFEST.MF file (Bundle-Properties: org.jpos.q2.autostart=true)
  • You can use your OSGi framework management console to add the property
  • You can use a system property (-Dorg.jpos.q2.autostart=true when you start your JVM)
Yes, we took what turned out to be an educated guess and did land on this way yesterday :-) .
  • You can use your OSGi framework to start jPOS’ bundle

The thing is you usually don’t just use a stand-alone jPOS, you probably have your own appliication that needs jPOS, so jPOS gets loaded and available, but not started until your own application (coming in another OSGi bundle) starts it.

Understood.

I think with this discussion for others to search for and find,  there will be less head scratching and I agree suggested changes are not needed.

Thanks apr

--
Mark

Alejandro Revilla

unread,
May 10, 2017, 10:06:01 PM5/10/17
to jPOS Users

Understood, I suspected there was some evolution - as a previous look I had seen the autostart happen, so was sad to find it didn't happen this try - it wasn't obvious why.

​I'm sorry for that change that I should have documented better, the OSGi stuff was in high flux in the early days when I made those changes. My fault.


You can see I've added -Dorg.jpos.q2.autostart=true to qnode.


Reply all
Reply to author
Forward
0 new messages