You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jonas Fügedi (JIRA)" <ji...@apache.org> on 2013/03/20 21:23:16 UTC
[jira] [Comment Edited] (CAMEL-6168) SQL component will not look
for parameters in header when no body in message
[ https://issues.apache.org/jira/browse/CAMEL-6168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13608131#comment-13608131 ]
Jonas Fügedi edited comment on CAMEL-6168 at 3/20/13 8:22 PM:
--------------------------------------------------------------
I find line 60 to be:
{code:xml}
if (exchange.getIn().getBody() != null) {
{code}
As seen in the repository here:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
Also, I believe the documentation clearly states that the headers are searched for parameters and the code does actually do this.
{quote}
"When using named parameters, Camel will lookup the names from, in the given precedence:
1. from message body if its a java.util.Map
2. from message headers"
{quote}
- http://camel.apache.org/sql-component.html
By just removing the if statement the code works.
was (Author: jonasf):
I find line 60 to be:
{code:xml}
if (exchange.getIn().getBody() != null) {
{code}
As seen in the repository here:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
Also, I believe the documentation clearly states that the headers are searched for parameters and the code does actually do this.
By just removing the if statement the code works.
> SQL component will not look for parameters in header when no body in message
> ----------------------------------------------------------------------------
>
> Key: CAMEL-6168
> URL: https://issues.apache.org/jira/browse/CAMEL-6168
> Project: Camel
> Issue Type: Bug
> Components: camel-sql
> Affects Versions: 2.11.0
> Environment: 2.11-SNAPSHOT
> Reporter: Jonas Fügedi
> Priority: Minor
>
> Line 60 in SqlProducer checks if the body is null. This will cause any parameters in header fields not to be populated into the prepared statement. Sample scenario is with a camel-jetty enriching a response using camel-sql.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira