WSO2 ESB - Dynamic value for proxy parameters (transport)

拟墨画扇 提交于 2019-12-23 12:29:06

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/11123151/wso2-esb-dynamic-value-for-proxy-parameters-transport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!