ensure unique vfs filename, access uuid from sequence

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

ensure unique vfs filename, access uuid from sequence

by Harm Verhagen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

to ensure the output filename of a vfs endpoint is unique I'd like to add the uuid to the filename.
How can I access the messages uuid from a sequence?



I'm already able to add the current time including ms to the name, but for messages handled in parallel this still could give collisions.
I the filename below I'd like to append the urn:uuid.

  <syn:property name="transport.vfs.ReplyFileName" expression="fn:concat('B_',get-property('SYSTEM_DATE', 'yyyyMMdd_HHmmss_'),fn:substring(get-property('SYSTEM_TIME'),8,6),'.xml')" scope="transport"/>
        <syn:send>
            <syn:endpoint>
                <syn:address uri="vfs:file:///home/incoming/inbox" format="pox"/>
            </syn:endpoint>
        </syn:send>


Regards,
Harm

_______________________________________________
Esb-java-user mailing list
Esb-java-user@...
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Re: ensure unique vfs filename, access uuid from sequence

by Ruwan Linton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Harm Verhagen wrote:
> Hi,
>
> to ensure the output filename of a vfs endpoint is unique I'd like to
> add the uuid to the filename.
> How can I access the messages uuid from a sequence?
Hi Harm,

You could easily get the message id using the get-property XPath
function as follows;

get-property('MessageID')

So the property mediator config will be;

<syn:property name="transport.vfs.ReplyFileName"
expression="fn:concat('B_',get-property('SYSTEM_DATE',
'yyyyMMdd_HHmmss_'),fn:substring(get-property('SYSTEM_TIME'),8,6),get-property('MessageID'),'.xml')"
scope="transport"/>

Thanks,
Ruwan

>
>
>
> I'm already able to add the current time including ms to the name, but
> for messages handled in parallel this still could give collisions.
> I the filename below I'd like to append the urn:uuid.
>
>   <syn:property name="transport.vfs.ReplyFileName"
> expression="fn:concat('B_',get-property('SYSTEM_DATE',
> 'yyyyMMdd_HHmmss_'),fn:substring(get-property('SYSTEM_TIME'),8,6),'.xml')"
> scope="transport"/>
>         <syn:send>
>             <syn:endpoint>
>                 <syn:address uri="vfs:file:///home/incoming/inbox"
> format="pox"/>
>             </syn:endpoint>
>         </syn:send>
>
>
> Regards,
> Harm
> ------------------------------------------------------------------------
>
> _______________________________________________
> Esb-java-user mailing list
> Esb-java-user@...
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>  


--
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@...; cell: +94 77 341 3097
blog: http://blog.ruwan.org



_______________________________________________
Esb-java-user mailing list
Esb-java-user@...
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user