Hi everybody,
is it possible to start a service when Ofbiz has started and is ready? Use case: I need to startup a connection to an external storage system. In my case a TCP/IP connection that is permanent. Best regards, Ingo |
Hello Ingo,
For this case, i think I would plan a job to run every X minutes, that will check if the connexion is alive or, establish it. The jobPoller will then take care of it after OFBiz is launched. Depending on the connexion type it might be enough. AFAIK there is no standard configuration to launch a service at OFBiz start. Gil On Tue, Jan 28, 2020 at 10:58:14AM +0100, Ingo Wolfmayr wrote: > Hi everybody, > > is it possible to start a service when Ofbiz has started and is ready? > > Use case: I need to startup a connection to an external storage system. In my > case a TCP/IP connection that is permanent. > > Best regards, > Ingo > > signature.asc (849 bytes) Download Attachment |
Is it important to establish the connection to the external storage
system only after OFBiz has been startet? Can it be established beforehand? If yes, I would either startup the connection in your OFBiz start script or completely independend of OFBiz on the server level (mounting on startup). Michael Brohl ecomify GmbH - www.ecomify.de Am 28.01.20 um 11:06 schrieb Gil Portenseigne: > Hello Ingo, > > For this case, i think I would plan a job to run every X minutes, that > will check if the connexion is alive or, establish it. > > The jobPoller will then take care of it after OFBiz is launched. > Depending on the connexion type it might be enough. > > AFAIK there is no standard configuration to launch a service at OFBiz > start. > > Gil > > On Tue, Jan 28, 2020 at 10:58:14AM +0100, Ingo Wolfmayr wrote: >> Hi everybody, >> >> is it possible to start a service when Ofbiz has started and is ready? >> >> Use case: I need to startup a connection to an external storage system. In my >> case a TCP/IP connection that is permanent. >> >> Best regards, >> Ingo >> >> smime.p7s (5K) Download Attachment |
In reply to this post by Gil Portenseigne
Hello Gil,
that was my first try either, unfortunately that is not working as when I restart Ofbiz, the service may crash and due to restarting a new pending job will not be created. So the service status has to be reviewed everytime the server is restarted and a new new job has to be created. If the server is restarted for some reasons Ofbiz will startup automatically but I want to avoid having dependencies on someone checking the service - or calling me to do it. Thanks for your thoughts! Best regards, Ingo Am Dienstag, 28. Jänner 2020, 11:06:15 CET schrieb Gil Portenseigne: > Hello Ingo, > > For this case, i think I would plan a job to run every X minutes, that > will check if the connexion is alive or, establish it. > > The jobPoller will then take care of it after OFBiz is launched. > Depending on the connexion type it might be enough. > > AFAIK there is no standard configuration to launch a service at OFBiz > start. > > Gil > > On Tue, Jan 28, 2020 at 10:58:14AM +0100, Ingo Wolfmayr wrote: > > Hi everybody, > > > > is it possible to start a service when Ofbiz has started and is ready? > > > > Use case: I need to startup a connection to an external storage system. In > > my case a TCP/IP connection that is permanent. > > > > Best regards, > > Ingo |
In reply to this post by Michael Brohl-3
Yes it is important as the external storage, in my case an automatic storage
system, sends messages to Ofbiz if inventory is requested. If it has the information that the connection is established, but unaware that Ofbiz is not ready it will run into problems - or makes it more complicated. I guess I will have to add the service database entries via the startup script. I was hoping to find a "cleaner" way, telling ofbiz to do something when ready. Thanks for the input. Ingo Am Dienstag, 28. Jänner 2020, 11:14:03 CET schrieb Michael Brohl: > Is it important to establish the connection to the external storage > system only after OFBiz has been startet? > > Can it be established beforehand? If yes, I would either startup the > connection in your OFBiz start script or completely independend of OFBiz > on the server level (mounting on startup). > > Michael Brohl > > ecomify GmbH - www.ecomify.de > > Am 28.01.20 um 11:06 schrieb Gil Portenseigne: > > Hello Ingo, > > > > For this case, i think I would plan a job to run every X minutes, that > > will check if the connexion is alive or, establish it. > > > > The jobPoller will then take care of it after OFBiz is launched. > > Depending on the connexion type it might be enough. > > > > AFAIK there is no standard configuration to launch a service at OFBiz > > start. > > > > Gil > > > > On Tue, Jan 28, 2020 at 10:58:14AM +0100, Ingo Wolfmayr wrote: > >> Hi everybody, > >> > >> is it possible to start a service when Ofbiz has started and is ready? > >> > >> Use case: I need to startup a connection to an external storage system. > >> In my case a TCP/IP connection that is permanent. > >> > >> Best regards, > >> Ingo |
In reply to this post by iwolf
Hi Ingo,
You can implement an OFBiz Container and declare it in your custom ofbiz-component.xml file. Also see Container.java from the sources. Another possible solution is to implement ServletContextListener and declare it in your custom web.xml file. Regards, James On 2020/01/28 09:58:14, Ingo Wolfmayr <[hidden email]> wrote: > Hi everybody, > > is it possible to start a service when Ofbiz has started and is ready? > > Use case: I need to startup a connection to an external storage system. In my > case a TCP/IP connection that is permanent. > > Best regards, > Ingo > > > |
Hi Ingo,
Please check the serviecengine.xml, you can define the startup-service there, I think this will fulfill your requirements =============== <!-- Start-Up Services --> <!-- - runtime-data-id refers to the RuntimeData entity for in-parameters - runtime-delay is the milliseconds after startup this service should run - run-in-pool is the name of the pool to run the job in; defaults to the send-to-poll (above) <startup-service name="testScv" runtime-data-id="9900" runtime-delay="0" run-in-pool="pool"/> --> ============== Kind Regards, Deepak Dixit DIRECTOR OF PRODUCT ENGINEERING mobile: +91 9826754548 email: [hidden email] *www.hotwax.co <http://www.hotwax.co/>* On Tue, Jan 28, 2020 at 9:12 PM James Yong <[hidden email]> wrote: > Hi Ingo, > > You can implement an OFBiz Container and declare it in your custom > ofbiz-component.xml file. > Also see Container.java from the sources. > > Another possible solution is to implement ServletContextListener and > declare it in your custom web.xml file. > > Regards, > James > > On 2020/01/28 09:58:14, Ingo Wolfmayr <[hidden email]> wrote: > > Hi everybody, > > > > is it possible to start a service when Ofbiz has started and is ready? > > > > Use case: I need to startup a connection to an external storage system. > In my > > case a TCP/IP connection that is permanent. > > > > Best regards, > > Ingo > > > > > > > |
In reply to this post by James Yong-2
Hi James,
I decided to go with the ServletContextListener. It does exactly what I need. Thanks a lot! Best regards, Ingo Am Dienstag, 28. Jänner 2020, 16:42:28 CET schrieb James Yong: > Hi Ingo, > > You can implement an OFBiz Container and declare it in your custom > ofbiz-component.xml file. Also see Container.java from the sources. > > Another possible solution is to implement ServletContextListener and declare > it in your custom web.xml file. > > Regards, > James > > On 2020/01/28 09:58:14, Ingo Wolfmayr <[hidden email]> wrote: > > Hi everybody, > > > > is it possible to start a service when Ofbiz has started and is ready? > > > > Use case: I need to startup a connection to an external storage system. In > > my case a TCP/IP connection that is permanent. > > > > Best regards, > > Ingo |
In reply to this post by Deepak Dixit-4
Hi Deepak,
thanks for the info. I will also give it a try. Thanks a lot! Best regards, Ingo Am Dienstag, 28. Jänner 2020, 20:46:42 CET schrieb Deepak Dixit: > Hi Ingo, > > Please check the serviecengine.xml, you can define the startup-service > there, I think this will fulfill your requirements > > =============== > <!-- Start-Up Services --> > <!-- > - runtime-data-id refers to the RuntimeData entity for in-parameters > - runtime-delay is the milliseconds after startup this service should run > - run-in-pool is the name of the pool to run the job in; defaults to the > send-to-poll (above) > <startup-service name="testScv" runtime-data-id="9900" runtime-delay="0" > run-in-pool="pool"/> > --> > ============== > > Kind Regards, > Deepak Dixit > DIRECTOR OF PRODUCT ENGINEERING > mobile: +91 9826754548 > email: [hidden email] > *www.hotwax.co <http://www.hotwax.co/>* > > On Tue, Jan 28, 2020 at 9:12 PM James Yong <[hidden email]> wrote: > > Hi Ingo, > > > > You can implement an OFBiz Container and declare it in your custom > > ofbiz-component.xml file. > > Also see Container.java from the sources. > > > > Another possible solution is to implement ServletContextListener and > > declare it in your custom web.xml file. > > > > Regards, > > James > > > > On 2020/01/28 09:58:14, Ingo Wolfmayr <[hidden email]> wrote: > > > Hi everybody, > > > > > > is it possible to start a service when Ofbiz has started and is ready? > > > > > > Use case: I need to startup a connection to an external storage system. > > > > In my > > > > > case a TCP/IP connection that is permanent. > > > > > > Best regards, > > > Ingo |
Free forum by Nabble | Edit this page |