Re: Charset being used to set Content-Encoding field since camel v4

2024-02-20 Thread Arthur Naseef
Here is a reproducer using the maven archetype:

https://github.com/artnaseef/camel-invalid-content-encoding

Art


On Fri, Feb 16, 2024 at 3:12 PM Arthur Naseef  wrote:
>
> Looking into an integration that was updated from camel v2 to v4, and having 
> problems with outbound "http" component requests being rejected downstream 
> due to an invalid Content-Encoding field.
>
> The request is including the following header:
>
> Content-Encoding: us-ascii
>
>
> Based on research, this is invalid.  Content-Encoding does not accept charset 
> names.  The Camel v2 version of the project does not set Content-Encoding.  
> No functional changes were made to the route - only necessary changes to 
> update to v4.
>
> After digging through the Camel code with the debugger and comparing the 
> original version of the integration and the updated one, I tracked down the 
> code in HttpProducer that used to set chartset but now sets encoding in the 
> StringEntity class. Below is a minimal program that reproduces the issue.
>
> // Sample route that incorrectly generates Content-Encoding: UTF-8
>
> public static void main(String[] args) {
> org.apache.camel.CamelContext camelContext = new 
> org.apache.camel.impl.DefaultCamelContext();
>
> try {
> camelContext.addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("direct:AAA")
> .setProperty(Exchange.CHARSET_NAME, constant("UTF-8"))
> .to("http://localhost:/redacted/endpoint/path;)
> ;
> }
> }
> );
>
> camelContext.start();
> camelContext.createProducerTemplate().sendBody("direct:AAA", "");
> Thread.sleep(2000);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> To test:
>
> 1. run nc -l 0.0.0.0 
>
> 2. compile and run that code (I personally used Intellij to run it out of 
> another class that already had all the necessary dependencies to run it)
>
> 3. profit (notice the Content-Encoding header)
>
>
> More Details...
>
> Camel v2
> Here is a little more detail on the history behind this change:
>
> In httpcore-4.4.15 the following constructor was being used by camel:
>
> public StringEntity(final String string, final String charset)
>
>
> Note the "charset" argument.  Here is the Camel HttpProducer line that calls 
> it:
>
> StringEntity entity = new StringEntity((String) data, charset);
>
>
> Camel v4
> In httpcore5-5.2.1, the following constructor is not being used by camel:
>
> public StringEntity(
> final String string, final ContentType contentType, final String 
> contentEncoding, final boolean chunked) {
>
>
> Note the lack of a "charset" argument.  Here is the Camel HttpProducer line 
> that calls it:
>
> answer = new StringEntity(content, contentType, charset, false);
>
>
> It appears the following commit changed the call to the StringEntity 
> constructor in HttpProducer:
>
> c33a140ce51aa9bc9a8205429b78e00a39041967
>
>
> Finding which versions contain that commit:
>
> $ git tag --contains c33a140ce51aa9bc9a8205429b78e00a39041967
>
> camel-4.0.0
>
> camel-4.0.0-M3
>
> camel-4.0.0-RC1
>
> camel-4.0.0-RC2
>
> camel-4.0.1
>
> camel-4.0.2
>
> camel-4.0.3
>
> camel-4.1.0
>
> camel-4.2.0
>
> camel-4.3.0
>
>
> I would submit a PR to fix it if I knew how to correctly obtain the desired 
> result - that is, that both the charset and content-encoding are set on the 
> StringEntity.
>
> Art
>


RE: How to set custom header(s) on message sent to Azure Service Bus

2024-02-20 Thread Shultz, Dmitry
When I test it using Quarkus (camel-azure-servicebus 4.3.0) I can see the 
CamelAzureServiceBusApplicationProperties map is preserved (I see the values on 
the receive side), but CamelAzureServiceBusCorrelationId is still null (setting 
CamelAzureServiceBusApplicationProperties and CamelAzureServiceBusCorrelationId 
at the same time).

In case there would be a fix for the CamelAzureServiceBusCorrelationId, how 
likely that is would be ported to the Java 8 Camel?

From: Andrea Cosentino 
Sent: Tuesday, February 20, 2024 9:45 AM
To: Shultz, Dmitry 
Cc: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

I can try to have a look, but probably with Camel 4. x. Can you double check if 
with 4. 0. 4 or 4. 4. 0 is still the case? Il giorno mar 20 feb 2024 alle ore 
18: 11 Shultz, Dmitry  ha scritto: Yes, I followed 
this
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd
I can try to have a look, but probably with Camel 4.x.

Can you double check if with 4.0.4 or 4.4.0 is still the case?

Il giorno mar 20 feb 2024 alle ore 18:11 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha scritto:
Yes, I followed this code https://stackoverflow.com/a/73886983 
[stackoverflow.com]
 and nothing ended up being set.
Also, as I said setting the ServiceBusConstants.CORRELATION_ID has no effect 
when checked at the destination.


From: Andrea Cosentino mailto:anco...@gmail.com>>
Sent: Tuesday, February 20, 2024 3:17 AM
To: Shultz, Dmitry mailto:dmitry_shu...@kaltire.com>>
Cc: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

I find some time this morning and sorry for the long delay. Did you had a look 
at the ServiceBusConstants. APPLICATION_PROPERTIES? They are meant for this 
purpose. Il giorno ven 9 feb 2024 alle ore 21: 20 Shultz, Dmitry 

ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd
I find some time this morning and sorry for the long delay.

Did you had a look at the ServiceBusConstants.APPLICATION_PROPERTIES?

They are meant for this purpose.

Il giorno ven 9 feb 2024 alle ore 21:20 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha scritto:
Next week would be awesome! Thanks Andrea.

From: Andrea Cosentino mailto:anco...@gmail.com>>
Sent: Friday, February 9, 2024 11:06 AM
To: Shultz, Dmitry mailto:dmitry_shu...@kaltire.com>>
Cc: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

Sorry, i still have to look at this. I hope to find some time next week. Il ven 
9 feb 2024, 19: 47 Shultz, Dmitry  ha scritto: Hi 
Andrea, Thanks for getting back to me! JFYI, I’m trying to set the 
ServiceBusConstants. CORRELATION_ID
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd
Sorry, i still have to look at this.

I hope to find some time next week.

Il ven 9 feb 2024, 19:47 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha scritto:
Hi Andrea,

Thanks for getting back to me!

JFYI, I’m trying to set the ServiceBusConstants.CORRELATION_ID header on the 
exchange before sending it to service bus and it doesn’t do anything (no 
correlationId on the receiving side) as well. Looks like all the headers being 
reset by something.

Dmitry

From: Andrea Cosentino mailto:anco...@gmail.com>>
Sent: Wednesday, January 17, 2024 10:18 AM
To: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

I'll try to check tomorrow and get back to you. Sorry for the late reply Il mer 
17 gen 2024, 19: 08 Shultz, Dmitry  ha scritto: > 
Have anybody used/successfully set headers on the message sent to Azure >
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd

I'll try to check tomorrow and get back to you.



Sorry for the late reply



Il mer 17 gen 2024, 19:08 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha

scritto:



> Have anybody used/successfully set headers on the message sent to Azure

> Service Bus before?

>

>

> Dmitry Shultz

> Senior Software Developer

>

> [cid:image001.png@01D051C6.BA585530]

>

> 1540 Kalamalka Lake Rd.

> Vernon, BC V1T 6V2

> t: 1-250-541-5447

> KalTire.com

>

>

> 

> From: Shultz, Dmitry

> Sent: 03 January 2024 19:08

> To: users@camel.apache.org 
> mailto:users@camel.apache.org>>

> Subject: How to set custom header(s) on message sent to Azure Service Bus

>

>

> Hi,

>

>

>

> I’m following this

> 

Re: How to set custom header(s) on message sent to Azure Service Bus

2024-02-20 Thread Andrea Cosentino
I can try to have a look, but probably with Camel 4.x.

Can you double check if with 4.0.4 or 4.4.0 is still the case?

Il giorno mar 20 feb 2024 alle ore 18:11 Shultz, Dmitry <
dmitry_shu...@kaltire.com> ha scritto:

> Yes, I followed this code https://stackoverflow.com/a/73886983 and
> nothing ended up being set.
>
> Also, as I said setting the ServiceBusConstants.CORRELATION_ID has no
> effect when checked at the destination.
>
>
>
>
>
> *From:* Andrea Cosentino 
> *Sent:* Tuesday, February 20, 2024 3:17 AM
> *To:* Shultz, Dmitry 
> *Cc:* users@camel.apache.org
> *Subject:* Re: How to set custom header(s) on message sent to Azure
> Service Bus
>
>
>
> I find some time this morning and sorry for the long delay. Did you had a
> look at the ServiceBusConstants. APPLICATION_PROPERTIES? They are meant
> for this purpose. Il giorno ven 9 feb 2024 alle ore 21: 20 Shultz, Dmitry
> 
>
> ZjQcmQRYFpfptBannerStart
>
> *This Message Is From an External Sender *
>
> ZjQcmQRYFpfptBannerEnd
>
> I find some time this morning and sorry for the long delay.
>
>
>
> Did you had a look at the ServiceBusConstants.APPLICATION_PROPERTIES?
>
>
>
> They are meant for this purpose.
>
>
>
> Il giorno ven 9 feb 2024 alle ore 21:20 Shultz, Dmitry <
> dmitry_shu...@kaltire.com> ha scritto:
>
> Next week would be awesome! Thanks Andrea.
>
>
>
> *From:* Andrea Cosentino 
> *Sent:* Friday, February 9, 2024 11:06 AM
> *To:* Shultz, Dmitry 
> *Cc:* users@camel.apache.org
> *Subject:* Re: How to set custom header(s) on message sent to Azure
> Service Bus
>
>
>
> Sorry, i still have to look at this. I hope to find some time next week.
> Il ven 9 feb 2024, 19: 47 Shultz, Dmitry  ha
> scritto: Hi Andrea, Thanks for getting back to me! JFYI, I’m trying to set
> the ServiceBusConstants. CORRELATION_ID
>
> ZjQcmQRYFpfptBannerStart
>
> *This Message Is From an External Sender *
>
> ZjQcmQRYFpfptBannerEnd
>
> Sorry, i still have to look at this.
>
>
>
> I hope to find some time next week.
>
>
>
> Il ven 9 feb 2024, 19:47 Shultz, Dmitry  ha
> scritto:
>
> Hi Andrea,
>
>
>
> Thanks for getting back to me!
>
>
>
> JFYI, I’m trying to set the ServiceBusConstants.CORRELATION_ID header on
> the exchange before sending it to service bus and it doesn’t do anything
> (no correlationId on the receiving side) as well. Looks like all the
> headers being reset by something.
>
>
>
> Dmitry
>
>
>
> *From:* Andrea Cosentino 
> *Sent:* Wednesday, January 17, 2024 10:18 AM
> *To:* users@camel.apache.org
> *Subject:* Re: How to set custom header(s) on message sent to Azure
> Service Bus
>
>
>
> I'll try to check tomorrow and get back to you. Sorry for the late reply
> Il mer 17 gen 2024, 19: 08 Shultz, Dmitry 
> ha scritto: > Have anybody used/successfully set headers on the message
> sent to Azure >
>
> ZjQcmQRYFpfptBannerStart
>
> *This Message Is From an External Sender *
>
> ZjQcmQRYFpfptBannerEnd
>
> I'll try to check tomorrow and get back to you.
>
>
>
> Sorry for the late reply
>
>
>
> Il mer 17 gen 2024, 19:08 Shultz, Dmitry  ha
>
> scritto:
>
>
>
> > Have anybody used/successfully set headers on the message sent to Azure
>
> > Service Bus before?
>
> >
>
> >
>
> > Dmitry Shultz
>
> > Senior Software Developer
>
> >
>
> > [cid:image001.png@01D051C6.BA585530]
>
> >
>
> > 1540 Kalamalka Lake Rd.
>
> > Vernon, BC V1T 6V2
>
> > t: 1-250-541-5447
>
> > KalTire.com
>
> >
>
> >
>
> > 
>
> > From: Shultz, Dmitry
>
> > Sent: 03 January 2024 19:08
>
> > To: users@camel.apache.org 
>
> > Subject: How to set custom header(s) on message sent to Azure Service Bus
>
> >
>
> >
>
> > Hi,
>
> >
>
> >
>
> >
>
> > I’m following this
>
> > https://urldefense.com/v3/__https://stackoverflow.com/questions/73886170/how-to-add-custom-properties-or-label-subject-for-azure-servicebus-topic-message__;!!LdWlNaMnLCM!fvRT9rucP7nxRYY_uiE0J6DPxhFrtSjgdkqKbHDou8H7hkTvafcdbNFZ5tPRrz-14z6qcJdtX5OqP-tCd5TD$
> >  
> > 
>
> > trying to set some custom headers for messages sent to Azure Service Bus,
>
> > but when I read the same message from the service bus it has no custom
>
> > headers and empty CamelAzureServiceBusApplicationProperties map.  Using
>
> > Camel 3.14.10
>
> >
>
> >
>
> >
>
> > Is there a bug or I’m doing/expecting something wrong?
>
> >
>
> >
>
> >
>
> > Thanks,
>
> >
>
> > Dmitry
>
> >
>
>


RE: How to set custom header(s) on message sent to Azure Service Bus

2024-02-20 Thread Shultz, Dmitry
Yes, I followed this code https://stackoverflow.com/a/73886983 and nothing 
ended up being set.
Also, as I said setting the ServiceBusConstants.CORRELATION_ID has no effect 
when checked at the destination.


From: Andrea Cosentino 
Sent: Tuesday, February 20, 2024 3:17 AM
To: Shultz, Dmitry 
Cc: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

I find some time this morning and sorry for the long delay. Did you had a look 
at the ServiceBusConstants. APPLICATION_PROPERTIES? They are meant for this 
purpose. Il giorno ven 9 feb 2024 alle ore 21: 20 Shultz, Dmitry 

ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd
I find some time this morning and sorry for the long delay.

Did you had a look at the ServiceBusConstants.APPLICATION_PROPERTIES?

They are meant for this purpose.

Il giorno ven 9 feb 2024 alle ore 21:20 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha scritto:
Next week would be awesome! Thanks Andrea.

From: Andrea Cosentino mailto:anco...@gmail.com>>
Sent: Friday, February 9, 2024 11:06 AM
To: Shultz, Dmitry mailto:dmitry_shu...@kaltire.com>>
Cc: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

Sorry, i still have to look at this. I hope to find some time next week. Il ven 
9 feb 2024, 19: 47 Shultz, Dmitry  ha scritto: Hi 
Andrea, Thanks for getting back to me! JFYI, I’m trying to set the 
ServiceBusConstants. CORRELATION_ID
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd
Sorry, i still have to look at this.

I hope to find some time next week.

Il ven 9 feb 2024, 19:47 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha scritto:
Hi Andrea,

Thanks for getting back to me!

JFYI, I’m trying to set the ServiceBusConstants.CORRELATION_ID header on the 
exchange before sending it to service bus and it doesn’t do anything (no 
correlationId on the receiving side) as well. Looks like all the headers being 
reset by something.

Dmitry

From: Andrea Cosentino mailto:anco...@gmail.com>>
Sent: Wednesday, January 17, 2024 10:18 AM
To: users@camel.apache.org
Subject: Re: How to set custom header(s) on message sent to Azure Service Bus

I'll try to check tomorrow and get back to you. Sorry for the late reply Il mer 
17 gen 2024, 19: 08 Shultz, Dmitry  ha scritto: > 
Have anybody used/successfully set headers on the message sent to Azure >
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd

I'll try to check tomorrow and get back to you.



Sorry for the late reply



Il mer 17 gen 2024, 19:08 Shultz, Dmitry 
mailto:dmitry_shu...@kaltire.com>> ha

scritto:



> Have anybody used/successfully set headers on the message sent to Azure

> Service Bus before?

>

>

> Dmitry Shultz

> Senior Software Developer

>

> [cid:image001.png@01D051C6.BA585530]

>

> 1540 Kalamalka Lake Rd.

> Vernon, BC V1T 6V2

> t: 1-250-541-5447

> KalTire.com

>

>

> 

> From: Shultz, Dmitry

> Sent: 03 January 2024 19:08

> To: users@camel.apache.org 
> mailto:users@camel.apache.org>>

> Subject: How to set custom header(s) on message sent to Azure Service Bus

>

>

> Hi,

>

>

>

> I’m following this

> https://urldefense.com/v3/__https://stackoverflow.com/questions/73886170/how-to-add-custom-properties-or-label-subject-for-azure-servicebus-topic-message__;!!LdWlNaMnLCM!fvRT9rucP7nxRYY_uiE0J6DPxhFrtSjgdkqKbHDou8H7hkTvafcdbNFZ5tPRrz-14z6qcJdtX5OqP-tCd5TD$

> trying to set some custom headers for messages sent to Azure Service Bus,

> but when I read the same message from the service bus it has no custom

> headers and empty CamelAzureServiceBusApplicationProperties map.  Using

> Camel 3.14.10

>

>

>

> Is there a bug or I’m doing/expecting something wrong?

>

>

>

> Thanks,

>

> Dmitry

>


Re: How to set custom header(s) on message sent to Azure Service Bus

2024-02-20 Thread Andrea Cosentino
I find some time this morning and sorry for the long delay.

Did you had a look at the ServiceBusConstants.APPLICATION_PROPERTIES?

They are meant for this purpose.

Il giorno ven 9 feb 2024 alle ore 21:20 Shultz, Dmitry <
dmitry_shu...@kaltire.com> ha scritto:

> Next week would be awesome! Thanks Andrea.
>
>
>
> *From:* Andrea Cosentino 
> *Sent:* Friday, February 9, 2024 11:06 AM
> *To:* Shultz, Dmitry 
> *Cc:* users@camel.apache.org
> *Subject:* Re: How to set custom header(s) on message sent to Azure
> Service Bus
>
>
>
> Sorry, i still have to look at this. I hope to find some time next week.
> Il ven 9 feb 2024, 19: 47 Shultz, Dmitry  ha
> scritto: Hi Andrea, Thanks for getting back to me! JFYI, I’m trying to set
> the ServiceBusConstants. CORRELATION_ID
>
> ZjQcmQRYFpfptBannerStart
>
> *This Message Is From an External Sender *
>
> ZjQcmQRYFpfptBannerEnd
>
> Sorry, i still have to look at this.
>
>
>
> I hope to find some time next week.
>
>
>
> Il ven 9 feb 2024, 19:47 Shultz, Dmitry  ha
> scritto:
>
> Hi Andrea,
>
>
>
> Thanks for getting back to me!
>
>
>
> JFYI, I’m trying to set the ServiceBusConstants.CORRELATION_ID header on
> the exchange before sending it to service bus and it doesn’t do anything
> (no correlationId on the receiving side) as well. Looks like all the
> headers being reset by something.
>
>
>
> Dmitry
>
>
>
> *From:* Andrea Cosentino 
> *Sent:* Wednesday, January 17, 2024 10:18 AM
> *To:* users@camel.apache.org
> *Subject:* Re: How to set custom header(s) on message sent to Azure
> Service Bus
>
>
>
> I'll try to check tomorrow and get back to you. Sorry for the late reply
> Il mer 17 gen 2024, 19: 08 Shultz, Dmitry 
> ha scritto: > Have anybody used/successfully set headers on the message
> sent to Azure >
>
> ZjQcmQRYFpfptBannerStart
>
> *This Message Is From an External Sender *
>
> ZjQcmQRYFpfptBannerEnd
>
> I'll try to check tomorrow and get back to you.
>
>
>
> Sorry for the late reply
>
>
>
> Il mer 17 gen 2024, 19:08 Shultz, Dmitry  ha
>
> scritto:
>
>
>
> > Have anybody used/successfully set headers on the message sent to Azure
>
> > Service Bus before?
>
> >
>
> >
>
> > Dmitry Shultz
>
> > Senior Software Developer
>
> >
>
> > [cid:image001.png@01D051C6.BA585530]
>
> >
>
> > 1540 Kalamalka Lake Rd.
>
> > Vernon, BC V1T 6V2
>
> > t: 1-250-541-5447
>
> > KalTire.com
>
> >
>
> >
>
> > 
>
> > From: Shultz, Dmitry
>
> > Sent: 03 January 2024 19:08
>
> > To: users@camel.apache.org 
>
> > Subject: How to set custom header(s) on message sent to Azure Service Bus
>
> >
>
> >
>
> > Hi,
>
> >
>
> >
>
> >
>
> > I’m following this
>
> > https://urldefense.com/v3/__https://stackoverflow.com/questions/73886170/how-to-add-custom-properties-or-label-subject-for-azure-servicebus-topic-message__;!!LdWlNaMnLCM!fvRT9rucP7nxRYY_uiE0J6DPxhFrtSjgdkqKbHDou8H7hkTvafcdbNFZ5tPRrz-14z6qcJdtX5OqP-tCd5TD$
> >  
> > 
>
> > trying to set some custom headers for messages sent to Azure Service Bus,
>
> > but when I read the same message from the service bus it has no custom
>
> > headers and empty CamelAzureServiceBusApplicationProperties map.  Using
>
> > Camel 3.14.10
>
> >
>
> >
>
> >
>
> > Is there a bug or I’m doing/expecting something wrong?
>
> >
>
> >
>
> >
>
> > Thanks,
>
> >
>
> > Dmitry
>
> >
>
>


Community Over Code Asia 2024 Travel Assistance Applications now open!

2024-02-20 Thread Gavin McDonald
Hello to all users, contributors and Committers!

The Travel Assistance Committee (TAC) are pleased to announce that
travel assistance applications for Community over Code Asia 2024 are now
open!

We will be supporting Community over Code Asia, Hangzhou, China
July 26th - 28th, 2024.

TAC exists to help those that would like to attend Community over Code
events, but are unable to do so for financial reasons. For more info
on this year's applications and qualifying criteria, please visit the
TAC website at < https://tac.apache.org/ >. Applications are already
open on https://tac-apply.apache.org/, so don't delay!

The Apache Travel Assistance Committee will only be accepting
applications from those people that are able to attend the full event.

Important: Applications close on Friday, May 10th, 2024.

Applicants have until the the closing date above to submit their
applications (which should contain as much supporting material as
required to efficiently and accurately process their request), this
will enable TAC to announce successful applications shortly
afterwards.

As usual, TAC expects to deal with a range of applications from a
diverse range of backgrounds; therefore, we encourage (as always)
anyone thinking about sending in an application to do so ASAP.

For those that will need a Visa to enter the Country - we advise you to
apply
now so that you have enough time in case of interview delays. So do not
wait until you know if you have been accepted or not.

We look forward to greeting many of you in Hangzhou, China in July, 2024!

Kind Regards,

Gavin

(On behalf of the Travel Assistance Committee)