File exception based routing question

View: New views
7 Messages — Rating Filter:   Alert me  

File exception based routing question

by gvsg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,
We want to implement a file exceptation based routing functionality.

When an exception occurs in a service (inbound,outboud endpoint or a component) we want to route the incoming file with its content to an error directory. Later on we can set monitoring on this directory to see wat was wrong with the input file and try to process the file again if needed.

For an outbound endpoint it works by using an "exception-based-router". But as far as I know you cannot use this for a component / inbound endpoint.

How can I handle these exceptions properly?

See below my example.

Kind regards,

Guy

<service name="exceptionTester">
<inbound>
<file:inbound-endpoint path="E:/ESB/exception/in" connector-ref="connectorThatWillNotThrowException"/>
</inbound>
<outbound>
<exception-based-router>
<file:outbound-endpoint path="E:/ESB/exception/out" outputPattern="#[ORIGINALNAME]"
connector-ref="connectorThatWillThrowException" />

<file:outbound-endpoint path="E:/ESB/exception/error" connector-ref="general" outputPattern="#[ORIGINALNAME]"/>
</exception-based-router>
</outbound>
</service>

Parent Message unknown Re: File exception based routing question

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Guy,

My suggestion is to use a file _connector_ exception strategy.

HTH,
Andrew

On Oct 28, 2009 8:39 AM, "gvsg" <gvsg_immo@...> wrote:


Hello all,
We want to implement a file exceptation based routing functionality.

When an exception occurs in a service (inbound,outboud endpoint or a
component) we want to route the incoming file with its content to an error
directory. Later on we can set monitoring on this directory to see wat was
wrong with the input file and try to process the file again if needed.

For an outbound endpoint it works by using an "exception-based-router". But
as far as I know you cannot use this for a component / inbound endpoint.

How can I handle these exceptions properly?

See below my example.

Kind regards,

Guy

<service name="exceptionTester">
<inbound>
<file:inbound-endpoint path="E:/ESB/exception/in"
connector-ref="connectorThatWillNotThrowException"/>
</inbound>
<outbound>
<exception-based-router>
<file:outbound-endpoint path="E:/ESB/exception/out"
outputPattern="#[ORIGINALNAME]"
connector-ref="connectorThatWillThrowException" />

<file:outbound-endpoint path="E:/ESB/exception/error"
connector-ref="general" outputPattern="#[ORIGINALNAME]"/>
</exception-based-router>
</outbound>
</service>

--
View this message in context: http://www.nabble.com/File-exception-based-routing-question-tp26093868p26093868.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Re: File exception based routing question

by gvsg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,

Andrew thanks for the quick reply but I'm not sure if the file connector-exception-strategy completely covers all my inbound or component exceptions?  What if I do an XSLT transformation on the incoming file in the inbound-endpoint.
What strategy exception should I then use if I want to route the file to an error folder when an error occurs?  

Kind regards,

Guy



Andrew Perepelytsya wrote:
Hi Guy,

My suggestion is to use a file _connector_ exception strategy.

HTH,
Andrew

On Oct 28, 2009 8:39 AM, "gvsg" <gvsg_immo@yahoo.com> wrote:


Hello all,
We want to implement a file exceptation based routing functionality.

When an exception occurs in a service (inbound,outboud endpoint or a
component) we want to route the incoming file with its content to an error
directory. Later on we can set monitoring on this directory to see wat was
wrong with the input file and try to process the file again if needed.

For an outbound endpoint it works by using an "exception-based-router". But
as far as I know you cannot use this for a component / inbound endpoint.

How can I handle these exceptions properly?

See below my example.

Kind regards,

Guy

<service name="exceptionTester">
<inbound>
<file:inbound-endpoint path="E:/ESB/exception/in"
connector-ref="connectorThatWillNotThrowException"/>
</inbound>
<outbound>
<exception-based-router>
<file:outbound-endpoint path="E:/ESB/exception/out"
outputPattern="#[ORIGINALNAME]"
connector-ref="connectorThatWillThrowException" />

<file:outbound-endpoint path="E:/ESB/exception/error"
connector-ref="general" outputPattern="#[ORIGINALNAME]"/>
</exception-based-router>
</outbound>
</service>

--
View this message in context:
http://www.nabble.com/File-exception-based-routing-question-tp26093868p26093868.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

Retrieving the name of the first inbound endpoint?

by Häggkvist, Lennart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have a problem retreiving the originating endpoint where the message was created.

I thought that
        eventContext.getMessage().getOriginalAdapter().getProperty("MULE_ORIGINATING_ENDPOINT")
should have returned the originating (ie. the first) endpoint?  

The config is added below.

In the first component (FooBarComponent) the above returns
        foo-bar-outbox
The last component (FooBar2Component) returns
        another-endpoint-name

I did expect to get "foo-bar-outbox", not "another-endpoint-name". How can I get the very first inbound adress
inside a Component (or a custom router)?

Thanks!
       
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
      xmlns:file="http://www.mulesource.org/schema/mule/file/2.2"
      xmlns:mule-xml="http://www.mulesource.org/schema/mule/xml/2.2"
      xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
               http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
               http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd
               http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd">

  <model name="foo">
    <service name="bar">
      <inbound>
        <file:inbound-endpoint name="foo-bar-outbox"
                               path="c:/temp/cbr/edok-outbox" synchronous="true" pollingFrequency="1000"/>
      </inbound>
      <component class="FooBarComponent"/>
      <outbound>
        <pass-through-router>
          <vm:outbound-endpoint address="vm://another-endpoint"/>
        </pass-through-router>
      </outbound>
    </service>
  </model>

  <model name="foo2">
    <service name="bar2">
      <inbound>
        <vm:inbound-endpoint path="another-endpoint" name="another-endpoint-name"/>
      </inbound>
      <component class="FooBar2Component" />
    </service>
  </model>
 
 
</mule>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Parent Message unknown Re: Retrieving the name of the first inbound endpoint?

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Copy it to a custom property in the transformer, so Mule doesn't overwrite it.

HTH,
Andrew

On Oct 29, 2009 6:39 AM, "Häggkvist, Lennart" <Lennart.Haggkvist@...> wrote:

Hi,

I have a problem retreiving the originating endpoint where the message was created.

I thought that
       eventContext.getMessage().getOriginalAdapter().getProperty("MULE_ORIGINATING_ENDPOINT")
should have returned the originating (ie. the first) endpoint?

The config is added below.

In the first component (FooBarComponent) the above returns
       foo-bar-outbox
The last component (FooBar2Component) returns
       another-endpoint-name

I did expect to get "foo-bar-outbox", not "another-endpoint-name". How can I get the very first inbound adress
inside a Component (or a custom router)?

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:spring="http://www.springframework.org/schema/beans"
     xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
     xmlns:file="http://www.mulesource.org/schema/mule/file/2.2"
     xmlns:mule-xml="http://www.mulesource.org/schema/mule/xml/2.2"
     xsi:schemaLocation="
              http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
              http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
              http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
              http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd
              http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd">

 <model name="foo">
   <service name="bar">
     <inbound>
       <file:inbound-endpoint name="foo-bar-outbox"
                              path="c:/temp/cbr/edok-outbox" synchronous="true" pollingFrequency="1000"/>
     </inbound>
     <component class="FooBarComponent"/>
     <outbound>
       <pass-through-router>
         <vm:outbound-endpoint address="vm://another-endpoint"/>
       </pass-through-router>
     </outbound>
   </service>
 </model>

 <model name="foo2">
   <service name="bar2">
     <inbound>
       <vm:inbound-endpoint path="another-endpoint" name="another-endpoint-name"/>
     </inbound>
     <component class="FooBar2Component" />
   </service>
 </model>


</mule>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Re: File exception based routing question

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Transformer exceptions are propagated to the endpoint's connector, so in this case it is still the same exception strategy on the file connector.

HTH,
Andrew

On Oct 29, 2009 4:46 AM, "gvsg" <gvsg_immo@...> wrote:


All,

Andrew thanks for the quick reply but I'm not sure if the file
connector-exception-strategy completely covers all my inbound or component
exceptions?  What if I do an XSLT transformation on the incoming file in the
inbound-endpoint.
What strategy exception should I then use if I want to route the file to an
error folder when an error occurs?

Kind regards,

Guy

Andrew Perepelytsya wrote: > > Hi Guy, > > My suggestion is to use a file _connector_ exceptio...

--
View this message in context: http://www.nabble.com/File-exception-based-routing-question-tp26093868p26109069.html

Sent from the Mule - User mailing list archive at Nabble.com. ------------------------------------...


Re: File exception based routing question

by gvsg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All, I wrote a custom exception strategy. I extended my custom strategy from the DefaultServiceExceptionStrategy. I have the problem that not all exceptions are catch. If I receive a transformation exception, that is catch but when I have an error in my custom file name parser wich throws an IndexOutOfBoundsException then the exception is not catched. Should I extend from another class? Kind regards, Guy
gvsg wrote:
Hello all, We want to implement a file exceptation based routing functionality. When an exception occurs in a service (inbound,outboud endpoint or a component) we want to route the incoming file with its content to an error directory. Later on we can set monitoring on this directory to see wat was wrong with the input file and try to process the file again if needed. For an outbound endpoint it works by using an "exception-based-router". But as far as I know you cannot use this for a component / inbound endpoint. How can I handle these exceptions properly? See below my example. Kind regards, Guy