OSB stage-level error handler missing - osb

I have developed an OSB 12.2 pipeline template, which includes an error handler attached to a stage that performs schema validation. When a validation fault is raised, the intent is to catch it in the stage handler, log the validation details, and raise a generic error.
At the service level, I have defined another error handler which is meant to catch the generic error thrown from the validation error handler and perform some other actions.
In JDeveloper, I have generated a pipeline from the template, and I can see that my handlers are both present in the pipeline and have the actions I have defined. I export the project to a JAR and successfully deploy via the service bus console, but when I look at the stage-level error handler in the console's pipeline viewer, none of my defined actions are present.
Image: Handler stage logic is missing
Predictably, any validation error is not caught at the stage level but goes straight to the service-level handler, which is not what I want.
If I start out with a regular non-template pipeline and code all the same actions and handlers, all is well. The error handler logic is present.
Image: Handler stage logic is present
Is there some trick to getting stage-level actions in template-linked pipelines to deploy and work correctly?

Related

Nagios Glabal event handler

what's the use case of global event handler in nagios and how can I configure it to send the information to my otherserver where I have to perform some action based on the information sent (like servicestate, service attempt etc.,)
Specifically, I just need a way to invoke a script, whenever any service goes off or any host dies irrespective of whatever it is
You define the event handler in the commands.cfg file in Nagios. Adding Nagios MACROS' as arguments to pass to the event handler. Then add the event handler to your default template (often generic-service), so that everything uses it. This is all explained in great detail in the Nagios Core documentation. Then the event handler script/program is ran AFTER each event.

Handle EntityCommandExecutionException and show error message

When I make a change in the database (add, delete, rename a column) and don't update my EF mappings, I get an exception while in debug mode
System.Data.Entity.Core.EntityCommandExecutionException
but I don't see this exception caught in the Global DispatcherUnhandledException even if I catch and throw it from the code where the exception is occuring. What is the reason? Basically I want to validate my EF mappings when my application loads and if there is any mismatch in mapping I want to show user a friendly message that Client Application needs to be updated.
An option would be to create a command interceptor. This concept was introduced in Entity Framework 6.0.
You create the interceptor by implementing the IDbCommandInterceptor interface and then register it either through code or configuration.
http://www.tutorialspoint.com/entity_framework/entity_framework_command_interception.htm
http://www.entityframeworktutorial.net/entityframework6/database-command-interception.aspx
https://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/connection-resiliency-and-command-interception-with-the-entity-framework-in-an-asp-net-mvc-application

CakePHP: Send emails for crashes

What's the best way to add email notifications for CakePHP crashes? I want to be emailed with a stacktrace whenever a fatal error occurs, so that I can know immediately instead of checking the logs.
I looked at overriding AppController::appError(); but I don't want to replace all of the exception handling.
Check this out, it is to long to paste here.
https://github.com/CakeDC/utils/blob/develop/Error/EmailErrorHandler.php
It is a customized error handler for CakePHP. You need to configure CakePHP to use that error handler class. My pull request to the core was rejected that introduced an Event in the handleError() method... An event there would make it really easy to handle use cases like this.

How to stop camel from deleting FTP file when processing fails and exception is handled by an error handler

I have a route that reads from an FTP server, then processes the message. The route has DeadLetterChannel error handler that routes the message to some bean when an exception is thrown while processing the message.
Now when an exception is handled by the error handler, Camel presumes everything passed fine and still deletes the FTP file.
If I remove the error handler, Camel doesn't delete the file when there is an exception.
Now my question is, how can i have a DeadLetterChannel error handler and at the same time stop Camel from deleting FTP file when processing fails?
You can set the option noop=true on the ftp endpoint. Then the file will be left alone.
Though you would then have to consider how you can skip picking up the files in the future? And for that you can use the idempotent repository to keep track of which files you have processed before. Or an alternative is to move the file when you are done etc.
As the ftp component extends the file component see details at: http://camel.apache.org/file2
You have several options to do that:
You do not use the delete=true option at all and handle the delete of the file in the "success" scenario by yourself. This would be relatively transparent.
In case you enter the DLC you can manipulate the endpoint from which you are consuming. Therefore just define your own processor for the DLC in onPrepareFailure. See example: deadLetterChannel("jms:dlc").onPrepareFailure(new ErrorProcessor())
After that you can use the getContext() method to get the camel context and one of the getEndpoint() methods to get your consumer endpoint.
When you have the endpoint you can see which 'process factory' class is used with the getProcessStrategyand there you can update the delete flag to avoid deleting your file.
For this endpoint it is also possible to define your own 'processStrategy' class with the method setProcessStrategy. Please take a look for yourself which process strategy class is used in your case. You then can override the according delete method like deleteLocalWorkFile and just do nothing.

How to display Salesforce Validation Rule error messages at once via the API

In the current version of Salesforce,
IF I have multiple Validation Rules Error message defined on one object
AND IF these rules are not respected when clicking on Save
THEN I get multiple error messages (all at once).
This is what I would like to have when using API calls.
As it is now, I am only getting error messages one by one via API calls. Is there any way to display all error messages at once, as it is in the Salesforce interface?
No, currently API processing stops at the first error and report thats, there's no way to have to report all the errors.

Resources