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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

jPOS - Users mailing list
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

--
--
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: [hidden email]
---
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] OSGI - org.jpos.q2.autostart - where to configure and the default setting?

Alejandro Revilla

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.





On Tue, May 9, 2017 at 6:35 AM, 'Mark Salter' via jPOS Users <[hidden email]> wrote:
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

--
--
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: [hidden email]
---
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
--
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: [hidden email]
---
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3DkMa%3DSPQFr1MuR-TYNAgA9dyMR_LysH8syvTbLoTHgKxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] OSGI - org.jpos.q2.autostart - where to configure and the default setting?

jPOS - Users mailing list


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

--
--
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: [hidden email]
---
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/48352e86-01b2-4ae1-8a1b-52dd8a51d64b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [jpos-users] OSGI - org.jpos.q2.autostart - where to configure and the default setting?

Alejandro Revilla

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.


--
--
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: [hidden email]
---
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3DkSDUUK1LfwL6hb_1mFPkBd_QZyh7K_B8nWen%2BySV2mbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.