Use a message property in an endpoint

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

Use a message property in an endpoint

by jej2003 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is it possible to read a property from a message and use it in an endpoint connector?  I would basically like to read a file name from a msg then use the File Provider Transport to move that file.  Any hints would be appreciated.

Re: Use a message property in an endpoint

by Jackie Wheeler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Take a look at the File Transport page at http://www.mulesource.org/display/MULE2USER/File+Transport. It describes the outputPattern attribute and the patterns supported by the filename parser. I think that's what you're looking for.

Hope that helps,
Jackie

JaM-9 wrote:
Is it possible to read a property from a message and use it in an endpoint
connector?  I would basically like to read a file name from a msg then use
the File Provider Transport to move that file.  Any hints would be
appreciated.

Re: Use a message property in an endpoint

by jej2003 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That looks like it would support what I am talking about for the outputPattern but I do not see something similar for the readFromDirectory.  But even if there was something for the readFromDirectory I don't see any way to say from a message with this property (file name=c:\blah\test.txt) read this file.  Am I missing it?

On Sat, Sep 27, 2008 at 3:20 AM, Jackie Wheeler <jackie.wheeler@...> wrote:

Take a look at the File Transport page at
http://www.mulesource.org/display/MULE2USER/File+Transport. It describes the
outputPattern attribute and the patterns supported by the filename parser. I
think that's what you're looking for.

Hope that helps,
Jackie


JaM-9 wrote:
>
> Is it possible to read a property from a message and use it in an endpoint
> connector?  I would basically like to read a file name from a msg then use
> the File Provider Transport to move that file.  Any hints would be
> appreciated.
>
>

--
View this message in context: http://www.nabble.com/Use-a-message-property-in-an-endpoint-tp19698869p19700352.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: Use a message property in an endpoint

by Jackie Wheeler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You use the <filename-wildcard-filter> on the inbound endpoint to filter the files you want to process by their file name.

For example:
<inbound>
   <file:inbound-endpoint path="C:/blah/">
         <file:filename-wildcard-filter pattern="test.txt" />
   </file:inbound-endpoint>
</inbound>

This filter is described on the File Transport page. You can also search this forum for "filename-wildcard-filter" to see some other examples users have posted.

Cheers,
Jackie


That looks like it would support what I am talking about for the
outputPattern but I do not see something similar for the readFromDirectory.
But even if there was something for the readFromDirectory I don't see any
way to say from a message with this property (file name=c:\blah\test.txt)
read this file.  Am I missing it?

Re: Use a message property in an endpoint

by jej2003 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That works great if I know the file names before hand, but the file name is actually in the header of the msg so i would need something like

<inbound>
  <file:inbound-endpoint path="${message/path}">
     <file:filename-wildcard-filter pattern="${message/fileName"/>
  </file:inbound-endpoint>
</inbound>

is this supported in Mule?

On Sat, Sep 27, 2008 at 12:25 PM, Jackie Wheeler <jackie.wheeler@...> wrote:

You use the <filename-wildcard-filter> on the inbound endpoint to filter the
files you want to process by their file name.

For example:
<inbound>
  <file:inbound-endpoint path="C:/blah/">
        <file:filename-wildcard-filter pattern="test.txt" />
  </file:inbound-endpoint>
</inbound>

This filter is described on the File Transport page. You can also search
this forum for "filename-wildcard-filter" to see some other examples users
have posted.

Cheers,
Jackie


That looks like it would support what I am talking about for the
outputPattern but I do not see something similar for the readFromDirectory.
But even if there was something for the readFromDirectory I don't see any
way to say from a message with this property (file name=c:\blah\test.txt)
read this file.  Am I missing it?

--
View this message in context: http://www.nabble.com/Use-a-message-property-in-an-endpoint-tp19698869p19704159.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: Use a message property in an endpoint

by Travis Carlson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, this is supported in Mule 2.x.  I believe the syntax would be as
follows, search the documentation for expression evaluators.

<inbound>
   <file:inbound-endpoint path="${header:path}">
      <file:filename-wildcard-filter pattern="${header:fileName}"/>
   </file:inbound-endpoint>
</inbound>

Travis

On Sat, 2008-09-27 at 20:56 -0400, Jamie Johnson wrote:

> That works great if I know the file names before hand, but the file
> name is actually in the header of the msg so i would need something
> like
>
> <inbound>
>   <file:inbound-endpoint path="${message/path}">
>      <file:filename-wildcard-filter pattern="${message/fileName"/>
>   </file:inbound-endpoint>
> </inbound>
>
> is this supported in Mule?
>
> On Sat, Sep 27, 2008 at 12:25 PM, Jackie Wheeler
> <jackie.wheeler@...> wrote:
>        
>         You use the <filename-wildcard-filter> on the inbound endpoint
>         to filter the
>         files you want to process by their file name.
>        
>         For example:
>         <inbound>
>           <file:inbound-endpoint path="C:/blah/">
>                 <file:filename-wildcard-filter pattern="test.txt" />
>           </file:inbound-endpoint>
>         </inbound>
>        
>         This filter is described on the File Transport page. You can
>         also search
>         this forum for "filename-wildcard-filter" to see some other
>         examples users
>         have posted.
>        
>         Cheers,
>         Jackie
>        
>        
>         That looks like it would support what I am talking about for
>         the
>         outputPattern but I do not see something similar for the
>         readFromDirectory.
>         But even if there was something for the readFromDirectory I
>         don't see any
>         way to say from a message with this property (file name=c:
>         \blah\test.txt)
>         read this file.  Am I missing it?
>        
>        
>         --
>         View this message in context:
>         http://www.nabble.com/Use-a-message-property-in-an-endpoint-tp19698869p19704159.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
>        
>        
>        
>
>


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

    http://xircles.codehaus.org/manage_email



Re: Use a message property in an endpoint

by jej2003 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Travis,

Is this supported in Mule 1.x or only 2.x?

Jamie

On Tue, Sep 30, 2008 at 7:56 AM, Travis Carlson <travis.carlson@...> wrote:
Yes, this is supported in Mule 2.x.  I believe the syntax would be as
follows, search the documentation for expression evaluators.

<inbound>
  <file:inbound-endpoint path="${header:path}">
     <file:filename-wildcard-filter pattern="${header:fileName}"/>
  </file:inbound-endpoint>
</inbound>

Travis

On Sat, 2008-09-27 at 20:56 -0400, Jamie Johnson wrote:
> That works great if I know the file names before hand, but the file
> name is actually in the header of the msg so i would need something
> like
>
> <inbound>
>   <file:inbound-endpoint path="${message/path}">
>      <file:filename-wildcard-filter pattern="${message/fileName"/>
>   </file:inbound-endpoint>
> </inbound>
>
> is this supported in Mule?
>
> On Sat, Sep 27, 2008 at 12:25 PM, Jackie Wheeler
> <jackie.wheeler@...> wrote:
>
>         You use the <filename-wildcard-filter> on the inbound endpoint
>         to filter the
>         files you want to process by their file name.
>
>         For example:
>         <inbound>
>           <file:inbound-endpoint path="C:/blah/">
>                 <file:filename-wildcard-filter pattern="test.txt" />
>           </file:inbound-endpoint>
>         </inbound>
>
>         This filter is described on the File Transport page. You can
>         also search
>         this forum for "filename-wildcard-filter" to see some other
>         examples users
>         have posted.
>
>         Cheers,
>         Jackie
>
>
>         That looks like it would support what I am talking about for
>         the
>         outputPattern but I do not see something similar for the
>         readFromDirectory.
>         But even if there was something for the readFromDirectory I
>         don't see any
>         way to say from a message with this property (file name=c:
>         \blah\test.txt)
>         read this file.  Am I missing it?
>
>
>         --
>         View this message in context:
>         http://www.nabble.com/Use-a-message-property-in-an-endpoint-tp19698869p19704159.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
>
>
>
>
>


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

   http://xircles.codehaus.org/manage_email




Re: Use a message property in an endpoint

by Daniel Feist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have a feeling this won't work because I don't think you can use  
expressions with header in here because the file hasn't yet been read  
from the file system so there is no message yet.

You will need to pick up all the files using the file inbound endpoint  
and then use a selective consumer router with a message property or  
expression filter or similar to only continue processing the ones you  
are interest in.

Dan

On Sep 30, 2008, at 8:56 AM, Travis Carlson wrote:

> Yes, this is supported in Mule 2.x.  I believe the syntax would be as
> follows, search the documentation for expression evaluators.
>
> <inbound>
>   <file:inbound-endpoint path="${header:path}">
>      <file:filename-wildcard-filter pattern="${header:fileName}"/>
>   </file:inbound-endpoint>
> </inbound>
>
> Travis
>
> On Sat, 2008-09-27 at 20:56 -0400, Jamie Johnson wrote:
>> That works great if I know the file names before hand, but the file
>> name is actually in the header of the msg so i would need something
>> like
>>
>> <inbound>
>>  <file:inbound-endpoint path="${message/path}">
>>     <file:filename-wildcard-filter pattern="${message/fileName"/>
>>  </file:inbound-endpoint>
>> </inbound>
>>
>> is this supported in Mule?
>>
>> On Sat, Sep 27, 2008 at 12:25 PM, Jackie Wheeler
>> <jackie.wheeler@...> wrote:
>>
>>        You use the <filename-wildcard-filter> on the inbound endpoint
>>        to filter the
>>        files you want to process by their file name.
>>
>>        For example:
>>        <inbound>
>>          <file:inbound-endpoint path="C:/blah/">
>>                <file:filename-wildcard-filter pattern="test.txt" />
>>          </file:inbound-endpoint>
>>        </inbound>
>>
>>        This filter is described on the File Transport page. You can
>>        also search
>>        this forum for "filename-wildcard-filter" to see some other
>>        examples users
>>        have posted.
>>
>>        Cheers,
>>        Jackie
>>
>>
>>        That looks like it would support what I am talking about for
>>        the
>>        outputPattern but I do not see something similar for the
>>        readFromDirectory.
>>        But even if there was something for the readFromDirectory I
>>        don't see any
>>        way to say from a message with this property (file name=c:
>>        \blah\test.txt)
>>        read this file.  Am I missing it?
>>
>>
>>        --
>>        View this message in context:
>>        http://www.nabble.com/Use-a-message-property-in-an-endpoint-tp19698869p19704159.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
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email