-
1. Re: REST reference questions
trohovsky Apr 8, 2014 8:59 AM (in response to hemartins)Hi Henrique,
a dynamic change of an address in REST binding have been already discussed in this thread: Dynamic soap, http and resteasy endpoints.
Checkout the rest-binding quickstart to see how to configure REST on a reference. You can see how to use path parameters in quickstarts/rest-binding/src/main/java/org/switchyard/quickstarts/rest/binding/WarehouseResource.java at master · jboss-…
Tomas
-
2. Re: REST reference questions
hemartins Apr 8, 2014 9:19 AM (in response to trohovsky)Thanks Tomas. I will check it
-
3. Re: Re: REST reference questions
hemartins Apr 8, 2014 11:11 AM (in response to trohovsky)I've tried to use properties in order to change the address. In my switchyard.xml I have:
<sca:reference name="Task" multiplicity="0..1" promote="ProcessComponent/Task"> <sca:interface.java interface="transformers.Task"/> <resteasy:binding.rest> <resteasy:interfaces>transformers.Task</resteasy:interfaces> <resteasy:address>{$refAddress}</resteasy:address> </resteasy:binding.rest> </sca:reference>
This works fine, but when I change the value of refAddress nothing happens, it still points to the original value. It seems the property value (and the switchyard.xml file) are only read once. Is there any other way to change the value of the address?
-
4. Re: Re: REST reference questions
trohovsky Apr 8, 2014 12:10 PM (in response to hemartins)You have a typo in your switchyard.xml, replace {$refAddress} with ${refAddress}. If it is just in the posted snippet and not in your switchyard.xml, then: How do you configure the property?
-
5. Re: Re: REST reference questions
hemartins Apr 8, 2014 12:44 PM (in response to trohovsky)Sorry my bad, it's only on the snippet. The switchyard.xml is correct and works fine. I configure the property using a properties file and I am injecting the file into the runtime environment using -P during Jboss start up.
When I change the property in the file or in the JBoss management console the switchyard ignores it... I think this is caused because the switchyard.xml is only read at the startup, so further changes are ignored... -
6. Re: Re: REST reference questions
trohovsky Apr 8, 2014 1:49 PM (in response to hemartins)You don't have to restart the whole JBoss AS/EAP. Re-deployment of the application worked for me. A substitution of properties is probably handled during deployment. Properties should be changed in the management console or by jboss-cli, changing of them in the properties file, loaded by -P, will not take an effect.
-
7. Re: Re: REST reference questions
hemartins Apr 8, 2014 2:09 PM (in response to trohovsky)Re-deployment works for me too. But it must be a way to change it dynamically without any redeployment... Later I will try other approaches.
Thanks a lot for your time Tomas.
Best Regards