Ingo,
What exactly you want to achieve, you want to run two independent services
on ECA trigger and should run independently without waiting for each other
then it would be possible. Add two ECA rules and use Sync in action.

And if you want two services run one by one on success or so then that also
possible. Add one ECA rule and two action with sync in sequence you want to
execute. The exact requirement would help to answer better.


Best Regards,
--
Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
http://www.mindpathtech.com
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Sun, Apr 26, 2020 at 6:21 PM Ankush Upadhyay <
ankush.upadh...@hotwaxsystems.com> wrote:

> Hello Ingo,
>
> Answer for question
> @Pawan: "Have you tried with mode="sync" instead of mode="async"? It should
> run both services simultaneously." Do you mean that in my example (one eca
> - two sync action services) the second service would be started without
> waiting for the first to return the result?
>
> No, with sync mode, all actions of particular service eca would execute one
> by one, If you want to go dipper to know how it works, you can review
> ServiceEcaRule.java and ServiceEcaAction.
>
>
> Kind Regards,
> Ankush Upadhyay
> Senior Technical Consultant
>
> *HotWax Systems*
> *Enterprise open source experts*
> cell: +91-8109201285
> office: 0731-409-3684
> http://www.hotwaxsystems.com
>
>
> On Sun, Apr 26, 2020 at 1:27 PM Ingo Wolfmayr <ingo.wolfm...@wolfix.at>
> wrote:
>
> > Hello Suraj, hello Pawan, Hello Nameet
> >
> > thanks for the fast responses.
> >
> > I have read the blog article aready + adjusting the service settings is
> > one of those things I try to improve before launching a new ofbiz
> > installation in production. So I guess I can check this of :) Adding an
> > additional server would be my last resort, but always taken into account.
> >
> > When it comes to async an sync services with the example below - I just
> > want to make sure I am not folling a wrong idea:
> >
> > 1) async services would run independenly, but depend on the interval
> > services are polled. Default 30 seconds. So I will have to change this
> to 5
> > seconds in order to have thoses services started "right away".
> > <action service="createInvoiceBeforeShipment" mode="async"
> persist="true"/>
> > <action service="sendOutputRequest" mode="async" persist="true"/> </eca>
> >
> > 2) sync services - the second service would wait for the first service +
> > it is possible to use the result of service one.
> > <action service="createInvoiceBeforeShipment" mode="sync" />
> > <action service="sendOutputRequest" mode="sync" /> </eca>
> >
> > @Pawan: "Have you tried with mode="sync" instead of mode="async"? It
> > should run both services simultaneously." Do you mean that in my example
> > (one eca - two sync action services) the second service would be started
> > without waiting for the first to return the result?
> >
> > With case 1 - would it make a difference if I create a single eca service
> > definition for each service to be called? Would they be called
> > independently?
> >
> > Thanks a lot.
> > Ingo
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Suraj Khurana <suraj.khur...@hotwax.co>
> > Gesendet: Samstag, 25. April 2020 08:05
> > An: ofbizuser <user@ofbiz.apache.org>
> > Betreff: Re: Multiple services run immediately
> >
> > Hello Ingo,
> >
> > Hope you are doing good.
> >
> > I am not sure about the environment you are currently trying to achieve
> > this. IMO, there are two ways:
> >
> > - For improving performance, we can set up multiple OFBiz servers in
> > parallel. Yes, we can set up two OFBiz servers, one calling sync service
> > and another dedicated for async services only.
> > Here [1] is a reference blog for more details.
> >
> > - You can increase jobs count in service engine [2], so that your OFBiz
> > server will be picking more jobs to complete at a time, be careful
> various
> > factors are responsible with this approach, like CPU core, deployed OFBiz
> > memory allocation, maximum DB threads enabled etc.
> >
> > [1]
> >
> >
> https://www.hotwaxsystems.com/ofbiz/ofbiz-tutorials/apache-ofbiz-performance/
> > [2] framework/service/config/serviceengine.xml
> >
> > HTH.
> > --
> > Best Regards,
> > Suraj Khurana
> > Senior Techincal Consultant
> >
> >
> > On Fri, Apr 24, 2020 at 11:01 PM Ingo Wolfmayr <ingo.wolfm...@wolfix.at>
> > wrote:
> >
> > > Hi everybody,
> > >
> > > I want to run two or more services immediately after another service
> > > has finished.
> > >
> > > For example printing creating/printing the invoice and starting the
> > > pick process should be done immediately after orderchange  Invoicing
> > > and picking are two different processes that should be initiated at the
> > same time.
> > > Picking should not wait until the invoice process is finished.
> > >
> > > Right no I have:
> > >
> > > <eca service="changeOrderStatus" event="commit"  run-on-error="false">
> > >        <condition field-name="orderTypeId" operator="equals"
> > > value="SALES_ORDER"/>
> > >         <condition field-name="statusId" operator="equals"
> > > value="ORDER_APPROVED"/>
> > >         <condition-field field-name="statusId" operator="not-equals"
> > > to-field-name="oldStatusId"/>
> > >         <action service="createInvoiceBeforeShipment" mode="async"
> > > persist="true"/>
> > >         <action service="sendOutputRequest" mode="async"
> > > persist="true"/> </eca>
> > >
> > > The problem with that is, that if there are other tasks in the queue
> > > (solr product update, ...) it may come to unwanted delays.
> > >
> > > Would runSyncIgnore work?
> > >
> > > It would be great if I could use th eca service definitions to to it.
> > >
> > > Best regards
> > > Ingo
> > >
> >
>

Reply via email to