7

I'm a newbie to WSO2 and I'm searching how to declare a registry property in the ESB to use it as a parameter to an inbound endpoint.

I saw that I could use it like this:

    <parameter key="conf:/repository/esb/esb-configurations/AdhesionSituations" name="transport.vfs.FileURI"/>

I also tried this:

<parameter key="synapse:get-property('AdhesionSituations') name="transport.vfs.FileURI"/>

But I can't find how to declare the property in the registry. I try to define a local entry, a metadata on a collection in the registry but no matter what, indbound endpoint can't find my property.

Help will be appreciated ^^

Julien

Julien GRESSE
  • 354
  • 1
  • 13

2 Answers2

1

The second parameter definition you tried is obsolete now. First one is the correct way to specify inbound endpoint as a registry entry.

Declaring a property in registry can be done using this guide and this.

Further, it seems you are using an older ESB version. It is recommended to use latest ESB version which is 5.0.0.

Hope this helps.

  • Thanks Heshitha. I got the part where I need to add a local entry but is it ok to use inline text or do I need to use XML and declare a ? Furthermore, I tried inline text to store a folder path but what's the path of my property once declared (conf:/repository/esb/esb-configurations/) ? – Julien GRESSE Sep 26 '16 at 07:25
  • I'm having the same issue, I can declare a local entry but I have no idea how I am actually supposed to reference it via the "conf:" syntax. I've tried various things that haven't worked. I also tried searching the registry to see where my local entries show up, as far as I can see they don't appear in the registry at all. – andynormancx Nov 03 '16 at 10:16
0

You can define a local entry in registry as below. Assume registry location is conf:/repository/esb/esb-configurations/

<localEntry xmlns="http://ws.apache.org/ns/synapse" key="AdhesionSituations">Value</localEntry> 

Then you can use the property as below in the configuration.

<property name="AdhesionSituationsProperty" expression="get-property('registry', 'conf://repository/esb/esb-configurations/AdhesionSituations')" scope="default" type="STRING"/> 
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
maheeka
  • 1,983
  • 1
  • 17
  • 25
  • Thank you. I will try that asap and I'll get back to you. – Julien GRESSE Nov 14 '16 at 07:06
  • I've tried something like that, but I don't know what path I am supposed to use to point to the registry. If I do a rgrep for the local entry I'm trying to use I only find it in the 'synapse-configs' folder, where it is defined. I don't see it appearing in any sort of registry file that I can reference. – andynormancx Nov 15 '16 at 13:20
  • To be clear, there is no 'repository/esb/esb-configurations' folder in my ESB install. – andynormancx Nov 15 '16 at 13:26
  • Yes it has to be the folder that you have specified in your registry path. I copied from the same folder path stated in the question. – maheeka Nov 15 '16 at 15:02
  • The path that I am referring to is not a physical folder in the ESB. As you can see it says "conf://repository/esb/esb-configurations". With the prefix conf: or gov: it means that we are referring to configuration or governance registry. You can follow https://docs.wso2.com/display/Governance530/Adding+a+Resource on ESB to add a registry resource. As per the above question a local entry is created in the configuration registry at the folder path repository/esb/esb-configurations/. I was answering based on the information in the question. – maheeka Nov 15 '16 at 15:08
  • Refer to https://docs.wso2.com/display/DVS380/Creating+Governance+Registry+Artifacts if you are using Developer Studio to create artifacts in registry – maheeka Nov 15 '16 at 15:10
  • I have a local entry called 'amazonSQS.accessKeyId', that was created using the 'Local Entries' section in the ESB web UI. How do I reference _that_ local entry ? I don't want to create any extra registries or anything else, I'm just trying to use that local entry that already exists and is used in other sequences etc – andynormancx Nov 15 '16 at 16:04
  • I've only just spotted that you are talking about properties. Local entries are working fine with properties, the question is about making them work with parameters on inbound endpoints. As far as I can tell inbound endpoint parameters don't support the expression attribute. – andynormancx Nov 15 '16 at 17:15