1

When I read a message with a WSO2 ESB Proxy, I need to define a specific datatype and this is then applying a certain MessageBuilder (defined in the axis2.xml).

But when the MessageBuilder fails (i.e. I try to read a text file with the XMLBuilder) I get an exception in the console, but my "faultSequence" is not called. But I need to do a certain Error Handling in case of any read problem.

How can I catch Exceptions from the Transport Layer (MessageBuilder) in a Proxy?

Community
  • 1
  • 1
Philipp
  • 4,645
  • 3
  • 47
  • 80

2 Answers2

1

As far as i understand , your requirement is to catch an Error in the Transport layer and handle that in the Application level (i.e : Mediation level). which means the layer above.

But i think it violates layered architecture of the messaging framework. You should catch the Exception at the Message Builder itself and throw an Axis Fault so that underlying synapse transport layer (in this case Axis2) will handle that error. (It will send a fault to the client.)

If we look at the TCP protocol stack that is the practice which is commonly used.

If you really want to filter this errors at mediation level. Catch that Error in the Message Builder and add a Message Context property or custom message and pass it as a successful message. And Do a filter in mediation level and handle.

But again that is ugly. :)

--Charith

CharithWiki
  • 175
  • 5
  • Nice workaround, but how do other people handle errors in the transportation layer? I'm using standard MessageBuilder and do not really think of changing the source of all of them just to propagate the exception to my synapse proxy. The sending of a fault to the client is often not really possible (like VFS/FTP problems, TCP/IP HL7 problems etc...) In these cases I really have to send an alert to the support team that maybe a FTP is not working anymore... But how can I do that? – Philipp Dec 21 '12 at 09:47
-1

Have you defined onError attribute in your configuration?

 <sequence name="main" onError="myFaultSequence">

You can have more information in this sample.

Shelan Perera
  • 1,753
  • 1
  • 11
  • 10
  • Yes I did, but the sequence is not called yet, the exception occurs already during reading of the file by the proxy... That's my problem... – Philipp Nov 19 '12 at 10:36