Hi David, You could use a Metadata API for this purpose. Stratos has one built in [1] or you could use something like etcd [2].
Once the relevant instance is started a cartridge agent extension/plugin [3] can publish its IP Address to the Metadata API. Then the dependent instance can read it using the same approach. [1] https://cwiki.apache.org/confluence/display/STRATOS/4.1.0+Metadata+API+Reference [2] https://github.com/coreos/etcd [3] https://github.com/apache/stratos/blob/master/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/packs/plugins/TomcatWSO2ISMetadataPublisher.py On Mon, Jun 29, 2015 at 10:56 PM, David Hbase <[email protected]> wrote: > Thanks Mariangela, > > But from my purpose, when I define the ESB cartridge, I do not know the > ActivaMQ IP ("*10.100.1.13*"), > > { > "name": "payload_parameter.MB_IP", > "value": "*10.100.1.13*" > } > > The ESB MB_IP will be created by our Stratos Application deployment. So > the "*10.100.1.13*" should be a macro / payload. > > -D > > > > On Mon, Jun 29, 2015 at 1:13 AM, Reka Thirunavukkarasu <[email protected]> > wrote: > >> Thanks Mari..! >> >> On Mon, Jun 29, 2015 at 1:36 PM, Mariangela Hills <[email protected]> >> wrote: >> >>> Will do! >>> >>> Regards, >>> Mariangela >>> >>> >>> *Mariangela Hills* >>> Senior Technical Writer - WSO2, Inc. http://wso2.com >>> Committer and PMC member - Apache Stratos >>> email:[email protected] | mobile: +94 773 500185 >>> >>> On Mon, Jun 29, 2015 at 10:33 AM, Reka Thirunavukkarasu <[email protected]> >>> wrote: >>> >>>> Hi David, >>>> >>>> Yah..This is possible..You can use properties section in cartridge >>>> definition to pass any key/value pairs to a cartridge which could be read >>>> by cartridge agent and exported as system properties. Hence you can use >>>> them in cartridge extensions. >>>> >>>> Sample key value pair would be as below: >>>> >>>> { >>>> "name": "payload_parameter.MB_IP", >>>> "value": "10.100.1.13" >>>> } >>>> >>>> @Mari, Can you add this also to the cartridge resource definition >>>> section? It looks like it is missing in the 4.1.0 doc? >>>> >>>> Thanks, >>>> Reka >>>> >>>> On Mon, Jun 29, 2015 at 6:07 AM, David Hbase <[email protected]> >>>> wrote: >>>> >>>>> Setup Stratos for a composition app, etc: Activemq, Wso2ESB >>>>> >>>>> In the ESB, we need the activemq's IP, >>>>> >>>>> In there anyway, we can pass or get this IP via a Macro / Parameter in >>>>> the Cartridge definitions? >>>>> >>>>> Thanks >>>>> -D >>>>> >>>>> >>>> >>>> >>>> -- >>>> Reka Thirunavukkarasu >>>> Senior Software Engineer, >>>> WSO2, Inc.:http://wso2.com, >>>> Mobile: +94776442007 >>>> >>>> >>>> >>> >> >> >> -- >> Reka Thirunavukkarasu >> Senior Software Engineer, >> WSO2, Inc.:http://wso2.com, >> Mobile: +94776442007 >> >> >> > -- Imesh Gunaratne Senior Technical Lead, WSO2 Committer & PMC Member, Apache Stratos
