let me explain you its like i am publishing 10 documents and while subscribing through broker trigger in the trigger service i need to insert data into database .
now while publishing upto 4 doc’s got published and trigger service saved into database but suddenly database is down, now since other docs are getting publish and trigger service is having error because of database down, its not saving in database but we want it to save that other 6 doc’s in database once database is up . now how can we handle and how to use resource monitoring service in trigger as i read it needed to be used in this case .
Use Trigger properties to set ‘Max retry attempts’ and ‘Retry interval’.
Catch your exception when database is down, wrap it with ISRuntimeException and throw it back. Use pub.flow:throwExceptionForRetry service in your catch block of parent service.
Refer Publish Subscribe guide for more details.
Senthil suggested also good and u can use resource monitoring along with retry mechanism.
Resource monitoring service will check the DB connection status before trigger invokes the associated service, You have to write a logic to determine whether DB is active or not and that service should have “pub.trigger:resourceMonitoringSpec” in specification tab. if DB down u can make the output as "false’ else true. If this service output is true then IS will activate the trigger and normal process follows. If this service output is false then trigger will be in disabled state until DB UP.
You can get more info from documentation. Please do more test before deploy in Production.
But keep in mind that using these will cause a performance impact during huge transactions. So take the decision accordingly.
Can you point of few issues with these implementation. I thought of it being helpful when the database is down, how can it effect the IS? is it because of queuing up of broker documents.
Please let me know.
Could you please let me know how to write a resource monitoring logic generic for all DB connections/end point urls?
Adapter Connections can be monitored by ART Build In Services.
For the others you will have to check if there are Build In Services for IntegrationServer.
See the appropriate Build In Services Guides for further informations.
Make sure your resource monitoring services uses pub.trigger:resourceMonitoringSpec as the service specification.
Different options are:
– You can create a adapter service to check “select sysdate from dual” and make the output of the above service (isAvailable to true or false)
– Write a ping or telnet service to ping/telnet your db and make the output of the above service (isAvailable to true or false)
– Else you can make use of pub.art.connection:queryConnectionState in case of JDBC adapter.
But my scenario is:
- I have publishing service that publishes a document.
- Trigger subscribes the document and checks if any resource monitoring service specifed in the properties.
- If specified,the resource monitoring service is invoked.
- The resource monitoring service should identify the subscribing service and identify the adapters/ wsdl connections referred in the subscribing service.
- Check the resource availability (adapters/ wsdls) and determine the output (isAvailable=true).
How to implement step 4 and 5.
Also you have advised to pub.triggers:resourceMonitoringSpecification in the resource monitoing service. how to refer the specification. is it just creating a string output with the name similar to that specification?
Go through “9-8_Publish_Subscribe_Developers_Guide.pdf” and understand the use of resource monitoring service in pub-sub model. Looks like you have a different understanding. Let me know if you still have any questions.