Re: Get routeId from Exchange / in Processor

2013-11-12 Thread anaCortes
Hi,

is there already in 3.x another way to get this route id to avoid doing the
next?

exchange.getUnitOfWork().getRouteContext().getRoute().getId()

Thanks in advance
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/Get-routeId-from-Exchange-in-Processor-tp5594662p5743081.html
Sent from the Camel - Users mailing list archive at Nabble.com.


JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-29 Thread anaCortes
Hi all,

in my Camel project we are using ActiveMQ queues in a synchronous way. The
basic idea is that we send messages to a queue, adding replyTo=xxx.REPLY to
have a shared fixed reply queue where receive the response.

I´ve started using JMeter to see how reacts the project with not only 1
consumer. I´m using more than 5 thread to send many messages to the queue at
the same time. 
The problem is that the first 3-4 messages are not consumed by the reply
queue. I can see the messages in the reply queue, but the consumer doesn´t
realize they are there. So in the end, the producer doesn´t receive the
response and a timeout is thrown:

 org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within: 255000 millis due reply message with correlationID:
ID-dhcp-123-int-xxx-de-52365-1350896553341-0-12 not received

Debugging the project, I´ve realized that the first 5 messages (one message
per thread) are sent in the same second (with only hundred milliseconds of
difference), and only one of them is consumed. The rest 4 messages keep
stuck on the reply queue. The next messages are well consumed meanwhile
these messages are still in the queue. I don´t know if the time could be
problem. The next messages are well consumed, but they have more than 1
second of difference.

I´ve also seen that the Message Selector has in the list the messages that
are always stuck on the reply queue. I don´t know how the reply consumer
realizes that a new message has arrived to the queue and why it ignores some
of them at the beginning.

Does anyone know how could be the problem?

I´m using Camel 2.10.2 and ActiveMQ 5.5.1.
We have to use fixed reply queues and as we are using a cluster environment,
we have to use shared and not exclusive queues. With exclusive queues it
seems this problem would be solved.

Thanks! :)

Ana





--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-29 Thread anaCortes
Hi Claus,

thank you for your quick answer.

With the option to do more frequent polling, do you mean the receiveTimeout
option? 

We are using this option to 250, so this should poll messages every 250 ms.
I don´t understand why some messages are always stuck on the reply queue if
the next messages are sent every more than 1 sec and this option is set to
250 ms. Then the stuck messages should be taken from the queue.

How are the messages from the reply queue taken/choosen?

Thanks.





--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721724.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-29 Thread anaCortes
> The messages should be consumed if its JMSCorrelationID matches a id 
> that was sent from a request. 

Where is this checking done? I could take a look at the code.

> It uses JMSSelector to match which messages to pickup as reply 
> messages, that matches JMSCorrelationID set on sending the request. 
> It builds a JMSSelector query from this code 
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java

> You can enable some TRACE logging to see the query. 

In the query, i can see the correlationIds of the stuck messages in the
reply queue always there. If they are in this list, should´t be picked from
the queue? What´s the next step after creating this query? I could take a
look also.

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721733.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-30 Thread anaCortes
Hi Christian,

> Could you check whether this issue also exists with ActiveMQ 5.7.0!? 

I´ve changed to ActiveMQ 5.7.0. I´ve been testing again with JMeter and the
error "The OUT message was not received..." is still happening with messages
that I see they are stuck in the reply queue. They should be consumed and i
cannot find why not.





--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721763.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-30 Thread anaCortes
This problem only happens with shared fixed reply queues, and not with
exclusive queues. 
But we are using a cluster environment, and the Camel documentation says
that exclusive queues are not good for this kind of environments. 




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721764.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-30 Thread anaCortes
> Do you have consumers on other boxes that also consume from this 
> shared reply queue? 

Yes, we have consumers on different cluster nodes for the same reply queue.
So we have to use shared reply queues but there´s still the "stuck messages"
problem :( 

Any idea why this problem happens? 




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721769.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-10-30 Thread anaCortes
> Can you try setting prefetch = 1 for the consumers 

I´ve added queuePrefetch="1" to the reply queue configuration but there´s
still the same problem. 

Depending if we use shared or exclusive reply queues in Camel, do we have to
change the activemq configuration also? If using exclusive reply queues
works well, shouldn´t shared queues work also with the same configuration? 




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5721784.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-05 Thread anaCortes
The problem seems solved if I use cacheConsumer="false" in the
CachingConnectionFactory in the ActiveMQ configuration:


...
cacheConsumers*" value="false" />


Anyone knows why this can solve the problem of the fixed reply queues?

Thanks.





--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722135.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-05 Thread anaCortes
Hi,

> What version of Camel are you using?
2.10.2

> And how have you configured the JMS component






























...

> and the route where you do request/reply? 

.to(ExchangePattern.InOut,
"activemq:ActiveMQ.DLQ?replyTo=xxx.REPLY&requestTimeout=255000&receiveTimeout=250&timeToLive=51")

How could this cacheConsumer="false" affect to the performance? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722155.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-06 Thread anaCortes
> You can configure this in the endpoint uri directly also 
?replyToCacheLevelName=CACHE_NONE 

Thanks! I prefer more your solution. Then i don´t need to change the
activemq configuration with cacheConsumers="false" :)




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722201.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-07 Thread anaCortes
The replyToCacheLevelName parameter doesn´t solve the problem. 

I´ve added the parameter in the configuration:
 
 
  
  

I´ve also tried adding it to the endpoint:
"activemq:ActiveMQ.DLQ?replyTo=xxx.REPLY&requestTimeout=255000&receiveTimeout=250&timeToLive=51&replyToCacheLevelName=CACHE_NONE"

But it doesn´t work.

Am i doing something wrong? 

Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722298.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-07 Thread anaCortes
> Why are you reading from the built-in DLQ queue of the broker? That 
seems odd/wrong.

I agree, i don´t like it. But this was there and i don´t know if there is
any weird reason to have that. I would change the queue. Could this cause
any problem?



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722300.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-07 Thread anaCortes
I´ve created a dummy unit test that checks that with fixed shared reply
queues and CachingConnectionFactory, the parameter replyToCacheLevelName
doesn´t solve the stuck messages in the reply queue problem.

In this test, I send 3 messages (at almost the same time) to one queue that
uses the replyTo parameter using inOut. After receiving the reply, the
message is sent to one mock (mock:result). In the end, this mock only
receives 1 message, not 3. And in the log i can read: 

16:20:13,169 INFO   org.apache.camel.impl.DefaultShutdownStrategy|
Waiting as there are still 2 inflight and pending exchanges to complete,
timeout in 10 seconds.
16:20:14,170 INFO   org.apache.camel.impl.DefaultShutdownStrategy|
Waiting as there are still 2 inflight and pending exchanges to complete,
timeout in 9 seconds.
...

This is the unit test:

public class FixedReplyQueueWithCachingConnectiongTest extends
CamelTestSupport {

protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();

ConnectionFactory connectionFactory = createConnectionFactory();
ActiveMQComponent activemqComponent = new ActiveMQComponent();
activemqComponent.setReplyToCacheLevelName("CACHE_NONE");
activemqComponent.setConnectionFactory(connectionFactory);
camelContext.addComponent("activemq", activemqComponent);

return camelContext;
}

private ConnectionFactory createConnectionFactory() {
ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
// optimize AMQ to be as fast as possible so unit testing is quicker
connectionFactory.setCopyMessageOnSend(false);
connectionFactory.setOptimizeAcknowledge(true);
connectionFactory.setOptimizedMessageDispatch(true);

// When using asyncSend, producers will not be guaranteed to send in
the order we 
// have in the tests (which may be confusing for queues) so we need
this set to false.
// Another way of guaranteeing order is to use persistent messages
or transactions.
connectionFactory.setUseAsyncSend(false);

connectionFactory.setAlwaysSessionAsync(false);

CachingConnectionFactory cached = new
CachingConnectionFactory(connectionFactory);
cached.setSessionCacheSize(100);
return cached;
}

@Test
public void testStuckMessagesWithFixedReplyQueue() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);

new MyThread().start();
new MyThread().start();
new MyThread().start();

assertMockEndpointsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:start")
.inOut("activemq:queue:foo?replyTo=queue:bar")
.to("mock:result");

from("activemq:queue:foo").transform(body().prepend("Bye
"));
}
};
}

class MyThread extends Thread {

public void run() {
template.requestBody("direct:start", "Camel"+getName(),
String.class);
}

}
}

If I change cacheConsumers to false in the CachingConnectionFactory, the
problem is solved:
cached.setCacheConsumers(false)

But i would like to deactivate the cache only for the reply queues, not in
general, using the replyToCacheLevelName.

Any idea why replyToCacheLevelName is not working? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722304.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-09 Thread anaCortes
nothing about this replyToCacheLevelName problem? ;)



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722393.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-12 Thread anaCortes
Hi Christian,

thank you for your answers :)

I´ve changed:
new ActiveMQConnectionFactory("tcp://localhost:61616") 
to:
new ActiveMQConnectionFactory("vm://myBroker")

With this change i can still reproduce the problem, but if you cannot do it
then I´m missing something...



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722565.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-12 Thread anaCortes
I´ve changed the unit test. Now i´m using the CamelJmsTestHelper for the
JmsComponent (now there´s no external broker) and i´ve added setAssertPeriod
to the mock.

/**
 * @author anacortes
 */
public class JmsReplyToCacheLevelNameTest extends CamelTestSupport {

protected CamelContext createCamelContext() throws Exception { 
CamelContext camelContext = super.createCamelContext(); 

ConnectionFactory connectionFactory =
CamelJmsTestHelper.createPersistentConnectionFactory(); 
ActiveMQComponent activemqComponent = new ActiveMQComponent(); 
activemqComponent.setReplyToCacheLevelName("CACHE_NONE"); 
activemqComponent.setConnectionFactory(connectionFactory); 
camelContext.addComponent("activemq", activemqComponent); 

return camelContext; 
} 

@Test 
public void testStuckMessagesWithFixedReplyQueue() throws Exception { 
getMockEndpoint("mock:result").expectedMessageCount(1); 
getMockEndpoint("mock:result").setAssertPeriod(200);

new MyThread().start(); 
new MyThread().start(); 
new MyThread().start(); 

assertMockEndpointsSatisfied(); 
} 

@Override 
protected RouteBuilder createRouteBuilder() throws Exception { 
return new RouteBuilder() { 
public void configure() throws Exception { 
from("direct:start") 
.inOut("activemq:queue:foo?replyTo=queue:bar") 
.to("mock:result"); 

from("activemq:queue:foo").transform(body().prepend("Bye
")); 
} 
}; 
} 

class MyThread extends Thread { 
public void run() { 
template.requestBody("direct:start", "Camel"+getName(),
String.class); 
} 
} 

}

Here we can see that the mock only receives one message (and not the three
messages). 

If we add to the CachingConnectionFactory, cacheConsumer to false, then the
mock will receive the three messages (the stuck messages are gone).

cached.setCacheConsumers(false);




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722598.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-16 Thread anaCortes
Do you recommend using PooledConnectionFactory instead of
CachingConnectionFactory? 

Because if the replyToCacheLevelName doesn´t solve the problem, maybe we
should change to PooledConnectionFactory...



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722837.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-11-16 Thread anaCortes
PooledConnectionFactory seems not to cache MessageConsumers. Then, the next
configuration would be the same idea?

PooledConnectionFactory == CachingConnectionFactory+cacheConsumers=false



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5722847.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Groovy problem when an expression is evaluated by Camel

2012-11-19 Thread anaCortes
Hi all,

does anyone have this problem before? Do you know why is this happening? 

Caused by: java.lang.VerifyError: (class:
org/codehaus/groovy/runtime/ArrayUtil, method: createArray signature:
()[Ljava/lang/Object;) Illegal type in constant pool
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at 
script1351594798068668539594.run(script1351594798068668539594.groovy:1)
at
org.apache.camel.language.groovy.GroovyExpression.evaluate(GroovyExpression.java:55)
at
org.apache.camel.processor.TransformProcessor.process(TransformProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
... 89 more

In the logs, i´ve also seen this problem:
Caused by: java.lang.VirtualMachineError: out of space in CodeCache for
adapters 

Any idea? 

Thanks,
Ana




--
View this message in context: 
http://camel.465427.n5.nabble.com/Groovy-problem-when-an-expression-is-evaluated-by-Camel-tp5722946.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Groovy problem when an expression is evaluated by Camel

2012-11-19 Thread anaCortes
Thanks all for your answers :)

The problem is that i´m not using any groovy expression, this is something
that Camel does internally. I´m using Camel 2.10.1.

By default,  -XX:ReservedCodeCacheSize was 32, and now it has be changed to
64. Should be 64 enough, or it would be better 128?

Thanks 

Best regards,
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/Groovy-problem-when-an-expression-is-evaluated-by-Camel-tp5722946p5722988.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-12-03 Thread anaCortes
Hi,

my problematic configuration had CachingConnectionFactory (with
cacheConsumers true by default) and not PooledConnectionFactory.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5723546.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Possible memory leak in org.apache.activemq.pool.PooledSession

2012-12-04 Thread anaCortes
Hi Claus,

we are having a similar problem. 

Our configuration is:
- Camel 2.10.1
- ActiveMQ 5.5.1

> In Camel 2.9 you can use replyToType=Exclusive, which would then not 
have this leak. 

We cannot use replyToType=Exclusive because we are using a cluster
environment, so we have to use shared reply queues. 


> The leak is possible to be fixed on the AMQ side, I will keep looking into
> this. 

Do you know if this problem was solved in some new version of ActiveMQ?

Thanks,
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/Possible-memory-leak-in-org-apache-activemq-pool-PooledSession-tp4964951p5723614.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-12-06 Thread anaCortes
Have you tried also with ActiveMQ 5.5.1? Right now, we are using this version
and we are not allowed to upgrade the AMQ version. 
In the end, we should do this because 5.5.1 has a memory leaks bug that has
occasioned us some pain ;)

Best regards,
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5723704.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-12-06 Thread anaCortes
Hi Scott, 

thank you for your answer, it´s really interesting :)

Then we should use PooledConnectionFactory and for that we need to upgrade
also AMQ to 5.7.0.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5723705.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-12-11 Thread anaCortes
PooledConnectionFactory is in 5.5.1 but with the bug:
https://issues.apache.org/jira/browse/CAMEL-4657 and this was affecting us.
For that, i said it would be good for us if we can upgrade to AMQ 5.7 :)

If we cannot do it, we will see the Claus´ idea about using FuseSource
ActiveMQ 
distributions :)

Best regards,
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5723887.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS - Shared fixed reply queue doesn´t consume all the messages

2012-12-11 Thread anaCortes
> The test works also with CachingConnectionFactory and ActiveMQ 5.5.1. 
> Could you update the test so that it will show your issue? Otherwise I'm 
> not sure whether we can find and resolve your issue.

Using cacheConsumers=false with CachingConnectionFactory solved our problem,
and if we can change in the close future to AMQ 5.7, we will change
CachingConnectionFactory to PooledConnectionFactory. 

Should this reply queue problem be working also with cacheConsumers=true?
Then what test should i update to trying solve this problem, the test i did?
:) 

Best regards,
Ana

 



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Shared-fixed-reply-queue-doesn-t-consume-all-the-messages-tp5721700p5723888.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Spring-ws producer: Response schema validation

2013-02-26 Thread anaCortes
Hi all,

i´m using the spring-ws component to send a request:



because this would affect all the spring-ws .

I´ve added the endpointMapping to the producer parameters
(endpointMapping=#xxx), but this seems it´s not working, the endointMapping
is not being set. 

Checking the SpringWebserviceComponent class, i´ve seen that the method
addEndpointMappingToConfiguration() is only used inside
addConsumerConfiguration().

Is there any way to add the endpointMapping to the spring-ws producer in an
easy way or should i try to extend this class on my own?

Thank you,
Ana



--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-ws-producer-Response-schema-validation-tp5728172.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Spring-ws producer endpointMapping

2013-02-27 Thread anaCortes
any idea about how to add an endpointMapping to a spring-ws producer? ;)



--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-ws-producer-endpointMapping-tp5728172p5728223.html
Sent from the Camel - Users mailing list archive at Nabble.com.


LDAP Component lose headers

2012-05-08 Thread anaCortes
Hi all,

I´m working with the Camel LDAP component. As we can read in the 
http://camel.apache.org/ldap.html LDAP page  "The result is returned in the
Out body". 
I´ve seen in the code of LdapProducer.java (process method), that we only
have this line related to the Out message:
exchange.getOut().setBody(data);

The *problem* here is that, only using this code line, we lose the IN
headers and I need to keep them.

I´ve tried to copy the In headers in the Out headers before calling the LDAP
endpoint using: a processor, the properties exchange, ... but LDAP always
gets this error:
javax.naming.directory.InvalidSearchFilterException: Empty filter; remaining
name 'ou=system'
at com.sun.jndi.ldap.Filter.encodeFilterString(Filter.java:37)
at com.sun.jndi.ldap.LdapClient.search(LdapClient.java:519)
at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1965)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1827)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1752)
at
com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338)
at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321)
at
javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
at
org.apache.camel.component.ldap.LdapProducer.simpleSearch(LdapProducer.java:99)
at
org.apache.camel.component.ldap.LdapProducer.process(LdapProducer.java:72)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115)
at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
 

I only need to add a dummy outHeader to get this LDAP error.

In the end, *the solution* i´ve used to solve this problem is extending the
LDAP component:
   

and i´ve added only this line before calling to the process method in the
LdapProducer,
   exchange.getOut().setHeaders(exchange.getIn().getHeaders());

I don´t like this solution but it´s the only one i´ve found to solve it. 

Is this a bug in the LDAP Component or the idea of not keeping the headers
is correct?

Thanks
Kind Regards,

Ana Cortés.





--
View this message in context: 
http://camel.465427.n5.nabble.com/LDAP-Component-lose-headers-tp5696602.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: LDAP Component lose headers

2012-05-09 Thread anaCortes
Ok :) i´ve already created a JIRA ticket
https://issues.apache.org/jira/browse/CAMEL-5260


--
View this message in context: 
http://camel.465427.n5.nabble.com/LDAP-Component-lose-headers-tp5696602p5696862.html
Sent from the Camel - Users mailing list archive at Nabble.com.