Search code examples
proxywso2mediatorapache-synapsewso2-esb

WSO2 ESB - Dynamic value for proxy parameters (transport)


I need to be able to specify a dynamic value for proxy parameter. Actually, I have to specify each parameter with complete URL like :

<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>

I see some samples with property mediator and I guess it's working for next proxies but the problem here is that I need to change the proxy parameters value before its execution I think. I tried with a "trigger" proxy calling a custom mediator which change SynapseConfiguration of required proxy but this wasn't working.

Is there a way to replace these fixed value with lookups to create some deployment configuration ?

Many thanks.


Solution

  • The Parameters in the Proxy service definitions are service level Parameters which is in the Axis2Service Configuration . They are used when you are initialing the Axis2Service in this case its the Synapse/WSO2 ESB proxy service. So you can't change the parameters dynamically on the fly.

    But i can suggest following approach. It might or might not applicable to your scenario.

    Have set of VFS proxies that listen for separate locations. Each will look at a give file extension. (one for .txt one for .foo etc..)

    Use another generic vfs proxy to copy files to correct places dynamically(which accepts any extension).(You can use vfs sender).

    Hope this helps.

    cheers, Charith