Question

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.

Was it helpful?

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

OTHER TIPS

You can check out this post How to dynamically route message in WSO2 ESB based on XML configuration file for an example how to dynamically set values in a proxy sequence.

You can do something this:

<parameter name="transport.vfs.FileNamePattern">
    <script language="js">mc.getProperty('MY_DYNAMIC_VALUE')</script>
</parameter>

I am not sure this will help you much, as I suspect that the vfs parameters are set when initializing the proxy and not on the fly. If you give it a try, if possible please post back to this thread if it works or not.

Regards, nidkil

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top