On Tue, Aug 26, 2014 at 2:03 PM, Andrei Stoica <
andrei.ionut.stoica@> wrote:
>
> public void setConnectionBean(MongoStep step) throws
> UnknownHostException{
>
> MongoClientURI uri = new MongoClientURI(getUri());
> mongo = new MongoClient(uri);
> }
Did you just need to change the MongoDB Database and the MongoDB
Collections?
I thought you also wanted to change the hostname and the port at runtime of
the Mongo server...
If that's not the case, you can even simplify your solution a lot! After
all, it seems that your dynamic router is always r
I managed to get it work this way:
In the camel.xml I declared my bean:
my route:
from("jms:mongoQueue")
.bean(MongoConnection.class, "setConnectionBean")
.process(new Processor() {
@Override
Can you post the code showing...?
a) how you add the bean.
b) how you construct the endpoint URI from within the "MongoConnection"
class' dynamic router method.
Regards,
*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.m
I tried adding the bean in the existing camel context like this:
from("jms:...")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
// add bean to context using getContext() method
}
)
.dynamicRouter(method(MongoConnection.class)) // in the MongoConnect
How can I add a bean to the registry? In the link mentioned by you there is
no conclusion. I've tried the solution from the last comment but it doesn't
work.
Also where should I add the the bean to the registry. I tried adding it in a
process prior to the dynamicRouter method and I get this error:
Hello Andrei,
This is an interesting use case.
Currently there is no easy way to support your scenario because the MongoDB
component requires a com.mongodb.Mongo bean in the registry, e.g.
mongodb:connectionBean?...
In your context:
...
However, many ideas come to mind. Y
Hello,
My problem is that the connection URI might change and I need a way to edit
it at runtime.
When the application will be started, the user will be prompted with a
screen to input the connection details. After he inputs them, I need a way
to route messages to that URI.
Any idea how I can do
You can use a property. Check this out:
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
On 22 August 2014 08:41, Andrei Stoica
wrote:
> Hello,
>
> I have a question regarding the mongoDB connection.
>
> In the CamelContext.xml I have the followin