Hi,

I am creating a microservice by using Jetty and spring dsl. I need to access
the mongo service which is already created in openshift. Based on the camel
documentation i need to create a MongoBean first in order to access mongo
component. The question in here how can i give the "service.host" and
"service.port" parameters to a Bean as constructor parameters ?


<bean class="com.mongodb.Mongo" id="MongoBean">
      <constructor-arg name="host" value="${service.host:mongo}" />
      <constructor-arg name="port" value="${service.port:mongo}" />
</bean>

I tried this and below approach by reading it from properties file and both
did not work.

***Spring XML ****
<bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
                <property name="location" 
value="classpath:application.properties"/>
        </bean>
    
    <bean class="com.mongodb.Mongo" id="mongoBean">
        <constructor-arg name="host" value="${mongodb.host}" />
        <constructor-arg name="port" value="${mongodb.port}" />
    </bean>
**************************

application.properties:

mongodb.host={{mongo.service.host}}
mongodb.port={{mongo.service.port}}


Thanks for the help









--
View this message in context: 
http://camel.465427.n5.nabble.com/Kubernetes-Openshift-service-endpoint-parameter-to-a-Bean-tp5791212.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to