Re: Karaf +Camel Blueprint not able to load bean from other active bundles.

2017-03-19 Thread Quinn Stevenson
Under Blueprint, beans are not directly available across Blueprint contexts.  
Exposing the beans as services (as you have done) is how you expose them for 
consumption by other bundles, but you need to reference the services - not the 
beans directly.



> On Mar 14, 2017, at 10:18 AM, kumar  wrote:
> 
> 
> Hi , 
> 
> We are using Blueprint + Camel + Karaf ,migrating from Spring .
> I am new to OSgi Blueprint . We are using Blueprint XML to define services
> from beans defined in blueprint xml.
> 
> After we added Service in Blueprint XML, atleast are getting from karaf as
> below:
> fyi: bundle  is in Active state
> karaf>service:list | grep custom
> [org.apache.camel.Processor, com.rnd.model.impl.PaymentServiceProcessorBase,
> com.rnd.generic.*CustomServiceProcessor*]
> osgi.service.blueprint.compname = *customPaymentProcessor*
> 
> I am sure bean is registering into OSGI Services. but somehow its not
> visible to other XML in other Bundle.
> 
> *Blueprint XML*::
> 
> 
> 
> Please help me how to get accesss this bean in Routes XML file in
> APPConfig(under karaf root Dir) Folder.
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Karaf-Camel-Blueprint-not-able-to-load-bean-from-other-active-bundles-tp5795454.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Pass the properties for each request coming between the route definitions

2017-03-19 Thread Taariq Levack
You're looking for "dynamic to", depending on your Camel version you may
have to use the recipient list eip instead.

See this faq
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

Cheers,
Taariq

On 19 Mar 2017 3:23 PM, "vcamel9"  wrote:

I am unable to pass properties using setProperty or setheader Please see
below? What is the best way?
I tried both ways(with header and property) but restlet uri definition is
not able to find the property value for .

http://camel.apache.org/schema/spring;>
 

//orderid/text()



direct:abcRoute





http://host:8080/ordDataPersist/order/orderData/getOrderData/${
orderid}"/>





   I have to use pass the properties for each request coming between the
route definitions. Anyone please let me know the best way to do it.




--
View this message in context: http://camel.465427.n5.nabble.
com/Pass-the-properties-for-each-request-coming-between-
the-route-definitions-tp5795777.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Pass the properties for each request coming between the route definitions

2017-03-19 Thread Claus Ibsen
Use { } in the restlet uri as it supports REST placeholders.

And then use a header for the orderId as that is what { } refers to.

An alternative is to use dynamic-to which works for any Camel endpoint
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

On Sun, Mar 19, 2017 at 2:23 PM, vcamel9  wrote:
> I am unable to pass properties using setProperty or setheader Please see
> below? What is the best way?
> I tried both ways(with header and property) but restlet uri definition is
> not able to find the property value for .
>
>  xmlns="http://camel.apache.org/schema/spring;>
>  
> 
>  propertyName="orderidInfo">//orderid/text()
>
> 
> 
> direct:abcRoute
> 
> 
>
> 
> 
>  uri="restlet:http://host:8080/ordDataPersist/order/orderData/getOrderData/${orderid}"/>
> 
> 
> 
>
>
>I have to use pass the properties for each request coming between the
> route definitions. Anyone please let me know the best way to do it.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Pass-the-properties-for-each-request-coming-between-the-route-definitions-tp5795777.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Pass the properties for each request coming between the route definitions

2017-03-19 Thread vcamel9
I am unable to pass properties using setProperty or setheader Please see
below? What is the best way? 
I tried both ways(with header and property) but restlet uri definition is
not able to find the property value for .   

http://camel.apache.org/schema/spring;>
 

//orderid/text()
  


direct:abcRoute





http://host:8080/ordDataPersist/order/orderData/getOrderData/${orderid}"/>





   I have to use pass the properties for each request coming between the
route definitions. Anyone please let me know the best way to do it. 
 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Pass-the-properties-for-each-request-coming-between-the-route-definitions-tp5795777.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Overriding HTTP client config while declaring routes.

2017-03-19 Thread Abhishek.Jha09
Hi,

I have a web application from which I'm calling around 50-60 rest/soap apis.
For this, I've created routes in JAVA DSL. Now, to have default application
level timeout settings, I've done configuration like this-

public class DefaultHttpClientConfig implements HttpClientConfigurer {   //
http4

@Override
public void configureHttpClient(HttpClientBuilder clientBuilder) {
clientBuilder.setDefaultRequestConfig(
RequestConfig.custom()
.setConnectTimeout(1000)
.setSocketTimeout(1000).build());
}
}
and I've set this in camel context like this-

static CamelContext ctx = new DefaultCamelContext(); 

static {
try {
HttpComponent httpComponent = ctx.getComponent("http4",
HttpComponent.class);
httpComponent.setConnectionTimeToLive(10);
httpComponent.setHttpClientConfigurer(new 
DefaultHttpClientConfig());
ctx.addRoutes(new DirectRestRouteBuilder());
ctx.start();
} catch (Exception e) {
e.printStackTrace();
}
}

Now when creating individual routes, I want to override these configuration,
so I'm trying this as shown below-

from("direct:success")
  
.to("http4://localhost:8089/mockcarrier/success?httpClient.socketTimeout=8000");

However, it seems that the direct configuration is not picked up. Where am I
going wrong?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Overriding-HTTP-client-config-while-declaring-routes-tp5795765.html
Sent from the Camel - Users mailing list archive at Nabble.com.