Camel 3.0.0 HTTP Basic auth parameters

2020-01-20 Thread Gerald Kallas - mailbox.org
Dear community,

I'm trying to setup the HTTP Basic auth with authMethod, authUsername and 
authPassword options and getting an HTTP 401 error.

When I'm going to Base64 encode the auth information within the "Authorization" 
header it works. Any help is appreciated.

Best
- Gerald


Proposal : camel-rabbitmq : RabbitMQProducer to override EXCHANGE_NAME/ROUTING_KEY headers if bridgeEndpoint

2020-01-20 Thread Jonathan Schoreels
Hi,

Currently, the camel-rabbitmq endpoints, if set as "bridgeEndpoint",
ignores the following exchange's headers : EXCHANGE_NAME & ROUTING_KEY, but
it keeps the previous headers setted, which leak information about the
origin of the event. For example, if my message comes from Exchange A, I
transform it and send it to Exchange B, the RabbitMQProducer will ignore
the headers set by A but still will send them to B, which could leaks some
internal info of A to the consumer of B.

Wouldn't it be more correct to replace those two headers, if we ignore them
? I can do the pull request, but I would like to discuss the idea before.

See RabbitMQProducer:processInOut and processInOnly for related code.


RE: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

2020-01-20 Thread Gv, Shivakumar
Hi ,

queryTimeout  is set on the statement correctly. It worked for me on SQL , 
Terradata , Oracle DB  except for DB2 data base .As you mentioned the DB2 jdbc 
driver might not be recognizing  this setting.

[TRACE]: org.apache.camel.util.IntrospectionSupport - Configured property: 
queryTimeout on bean: com.ibm.db2.jcc.am.no@1c5e9bda with value: 1
[TRACE]: org.apache.camel.util.IntrospectionSupport - Configured property: 
maxRows on bean: com.ibm.db2.jcc.am.no@1c5e9bda with value: 100
[DEBUG]: org.apache.camel.component.jdbc.JdbcProducer - Executing JDBC 
Statement: select * from  ABCD.T5700_AST_PUR_HST

Thanks,
Shiva

-Original Message-
From: Claus Ibsen 
Sent: Tuesday, January 14, 2020 9:02 PM
To: users@camel.apache.org
Subject: Re: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

*EXTERNAL SENDER*


Hi

Debug the code and see if the queryTimeout is set on the JDBC statement - that 
is after all what Camel does.
Whether and how the timeout works is the JDBC driver.


On Tue, Jan 14, 2020 at 4:27 PM Gv, Shivakumar  wrote:
>
> Hi Claus,
>
> Thanks for the reply. Yes I agree with your point . I just mentioned my 
> observation that socket timeout is working.
>
> But my requirement is to set  queryTimeout  and both the below methods did 
> not work.
>
> for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1=0
> > for sql: I tried passing timeout value a
> > sql:quey?template.queryTimeout=1
>
> Thanks,
> Shiva
>
> -Original Message-
> From: Claus Ibsen 
> Sent: Tuesday, January 14, 2020 8:49 PM
> To: users@camel.apache.org
> Subject: [EXTERNAL] Re: query timeout not working in JDBC or SQL
> component
>
> *EXTERNAL SENDER*
>
>
> Hi
>
> A socket timeout and a query timeout are likely not the same. Socket is 
> network level. Query is likely on the database level.
>
> On Tue, Jan 14, 2020 at 4:00 PM Gv, Shivakumar  
> wrote:
> >
> > Hi Team,
> >
> > I am using camel version: 2.23.1
> >
> > Query timeout not working in both JDBC or SQL component.
> >
> > for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1=0
> >
> >
> >
> > for sql:
> >
> > i tried passing timeout value a  sql:quey?template.queryTimeout=1
> >
> >
> >
> > but if i set the socket timeout (defaultQueryTimeout) value in basic data 
> > source that works.but individual Statement query timeout is not working.
> >
> > please help me with this issue.
> >
> >
> >
> > Thanks,
> >
> > Shiva
> >
> > 
> > NOTICE: All information in and attached to the e-mails below may be 
> > proprietary, confidential, privileged and otherwise protected from improper 
> > or erroneous disclosure. If you are not the sender's intended recipient, 
> > you are not authorized to intercept, read, print, retain, copy, forward, or 
> > disseminate this message. If you have erroneously received this 
> > communication, please notify the sender immediately by phone (704-758-1000) 
> > or by e-mail and destroy all copies of this message electronic, paper, or 
> > otherwise. By transmitting documents via this email: Users, Customers, 
> > Suppliers and Vendors collectively acknowledge and agree the transmittal of 
> > information via email is voluntary, is offered as a convenience, and is not 
> > a secured method of communication; Not to transmit any payment information 
> > E.G. credit card, debit card, checking account, wire transfer information, 
> > passwords, or sensitive and personal information E.G. Driver's license, 
> > DOB, social security, or any other information the user wishes to remain 
> > confidential; To transmit only non-confidential information such as plans, 
> > pictures and drawings and to assume all risk and liability for and 
> > indemnify Lowe's from any claims, losses or damages that may arise from the 
> > transmittal of documents or including non-confidential information in the 
> > body of an email transmittal. Thank you.
>
>
>
> --
> Claus Ibsen
> -
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdavsc
> laus.comdata=02%7C01%7Cshivakumar.gv%40lowes.com%7C709f1a140abf44
> 4740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C0%7C637146
> 128252052518sdata=97HvZLBmgew5k3MmiOV5MpxTcclWQSMJYzybVdcA%2BfA%3
> Dreserved=0 @davsclaus Camel in Action 2:
> https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> manning.com%2Fibsen2data=02%7C01%7Cshivakumar.gv%40lowes.com%7C70
> 9f1a140abf444740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%
> 7C0%7C637146128252052518sdata=mW0xq%2B1ErKDQ17nKPQm1WjgygBwWGq%2B
> ND8UoPYZ94KI%3Dreserved=0
> 
> NOTICE: All information in and attached to the e-mails below may be 
> proprietary, confidential, privileged and otherwise protected from improper 
> or erroneous disclosure. If you are not the sender's intended recipient, you 
> are not authorized to intercept, read, print, retain, copy, forward, or 

Re: Micrometer/Prometheus Metric Count

2020-01-20 Thread Omar Al-Safi
Hi Steve,

in regards to the JIRA issue you added here, it looks like these metrics
are for MicroProfile component (
https://camel.apache.org/components/latest/microprofile-metrics-component.html),
perhaps you can try with microprofile component instead?

Regards,
Omar

On Sat, Jan 18, 2020 at 12:16 AM Steve Davids  wrote:

> I have recently migrated to Camel 3.0 (using Spring Boot) and found that
> there was a change in behavior for our metrics which drives some dashboards
> which shows the number of requests in our primary "process" exchange. The
> old code performed a prometheus query which counted the sum of  an earlier
> stage's CamelMessageHistory_seconds_count and compared it to the count of
> the same metric of the primary "process" stage. Camel 2.x seemed to only
> increment the count upon exit of the stage while Camel 3.x seems to
> increment the count upon starting the stage. This nuance throws off our
> timing graphing and we can't simply choose the "next" component in the
> chain because there is global exception handling that might be triggered
> from the process which wouldn't allow us to watch a single component "next
> in line".
>
> Taking a step back, I would like to find out what the best way to get a
> simple count of "in flight" count into Micrometer/Prometheus. Ideally Camel
> would provide this functionality natively and would allow me to filter on
> the nodeId of the process I'm interested in, but that metric doesn't seem
> to be exposed (though it seems to be exposed for other metrics components
> ). I also tried to do:
>
> > .doTry()
> > .toF("micrometer:counter:%s", INFLIGHT_METRIC_NAME)
> > .process(handler)
> > .doFinally()
> > .toF("micrometer:counter:%s?decrement=1", INFLIGHT_METRIC_NAME)
> > .end()
> >
>
> But with that configuration my global exception handling breaks for the
> `process(handler)` code. Does anyone have suggestions as to how to
> accomplish this or if Camel should natively support this use-case?
>
> Thanks,
>
> -Steve
>