status of a service,

Hi comunitty,

i have the execution of a service depend on a trigger, and after all my elements trigrred was traited

i need to execute a flow service , how can i get status of my first service so as to lunch the second one,

Regards,

I didn’t understand your question properly.

If you want to depend on some service to kick-off some other service,keep a flag on the dependant service, if flag is ‘Green’ then kick-off second service,if the flag is something else then exit from main. Is that making sense ?

Thanks,

hi,
thank you for yr rply,i can explain more,

i get values from a database(number of lines are variable) and then i sent one(document contain value) by one to my UM, my trigger lunch the service every time he find a document in UM, what i need is after all my service calls ,whatever there numbers, execute the seconde service(this services need that all values were traiten to be executed),

Regards,

In the doc which you send with value, keep a flag as well like Status. Only for the last record keep the status to ‘Finished’ and for rest keep as ‘In-Progress’. In the service keep checking status flag, when it becomes ‘Finished’ do your business logic. Hope this will help you.

Thanks,

hi,
the probleme is i can’t know the last doc because it dépends on number of lines exists in my database table, how can i know the last record??

Regards,

How you are reading the DB ? Through JDBC Adapter ?

Thanks,

Yes

when you are using the select query, you have ResultField column which indicates number of records retrieved from DB, can’t you make use of it ? Still doubts ?

Thanks,

If the records need to process in sequence, maybe you can try the configure the Trigger Properties > Message Processing > Processing Mode, set it to “Serial”, you can apply this if the transaction load is not too heavy.

trigger property.png

hi,
thank you all for yr replies,

@MR as173d : i will give it a try,
@Ben Ng : i don’t understand how serial mode will help to know the end of all service calls,

Regards,

I’m also a bit confused, but if I understand correctly:

  1. A service retrieves multiple records from a database (the number of records is variable)
  2. It publishes each record
  3. Another service subscribes to each record

You want the service from #3 to know when all records have been published so it can do something else? Is that it?

If so, consider changing your trigger so that it subscribes to 2 types of documents with an OR condition: one document is your existing “data” document and the other is a “control” document. In your publishing service, after you publish all the data documents, publish the control document. In the subscribing service, have a BRANCH that handles the two different types of documents.

If you set your trigger to serial, the control document will be received only after all data documents have been processed, so your trigger service can use that as an indication that it has received all records. This is a pattern that is typically used when batching individual records into a file that needs to be transmitted as a whole.

Hope this helps,
Percio

hi,
@Percio Castro : thank you for yr reply, yes its exactly what i want, i resolve my probleme by using pub.storage built in services i creat a globale variable which can be shared between all my packages,

i like yr idea i will give it a try too,

Regards,

I discourage the use of the pub.storage services unless absolutely necessary. I’ve seen many performance issues related to those services as well as poor use of those services leading to locks that are never cleared. Plus, I’m not sure a global variable is the best solution for this problem.

Give my idea a shot and let me know if you have further questions.

Percio

hi,

hhh it’s like yr here with me, i’ve juste detected that problem, i will give yr idea a try, thank you so much,

Regards,

Hi,

for the trigger settting concurrent vs. serial:

serial is only required in clustered IS environments.

In single node environments it is sufficient to set the trigger to concurrent with only one thread available.

There is an article in the community wiki about this.

Regards,
Holger

Holger,

I understand the potential benefits of setting a trigger to concurrent with only one thread in a clustered environment, but I’m failing to see a benefit to doing that in a single node environment vs. leaving the trigger as serial. Can you explain?

Percio

Hi Percio,

you misunderstood.

When setting a trigger to concurrent(1 thread) in a cluster this will behave as 2 parallel threads (one for each node).
Therefore it is neccessary to set these triggers to serial(1 thread) if the order needs to be pertained.

When setting a trigger to concurrent(1 thread) instead of serial(1 thread) in a single node environment this causes less JVM overhead on the trigger/thread handling leading to a higher performance.

See the following TechCommunity Wiki Article for further informations resp. explanations:
http://techcommunity.softwareag.com/web/guest/pwiki/-/wiki/Main/Setting%20Correct%20Trigger%20Parameters

Regards,
Holger

Thanks, Holger. I understood what you said, I was just unaware of a significant performance improvement in a single node environment when comparing a 1-thread concurrent trigger to a serial trigger. The link itself doesn’t seem to address that very specific scenario so I’ll do some benchmarking of my own when I get a chance and I’ll report back the results.

Percio

Percio, we may not observe much variation in terms of performance but yes, we should agree with Holger on this :). Sure we will wait for your response.

Thanks,

Hi,

the overall performance depends on different factors like JVM version being used (Java 5, 6, 7, 8), concrete load (number and size of documents) and partially OS (AIX or HP UX will be behave different then OSes which are running a JVM directly provided by Oracle).

Regards,
Holger