camel-kafka-connector icon indicating copy to clipboard operation
camel-kafka-connector copied to clipboard

KC with Event Hubs Sink 1.0.0

Open egonbaren opened this issue 3 years ago • 12 comments

Hi. I want to use Camel Sink KafkaConnector (1.0.0) with Azure Event Hubs forwarding event to Azure, but it doesn't look like to forward headers. There is possibility to remove headers explicitly. Should default behaviour forward all the headers or not?

camel.remove.headers.pattern=CamelAwsS3BucketName https://camel.apache.org/camel-kafka-connector/next/user-guide/remove-headers.html

Events are forwarder but headers are missing, are there any plans to enable it?

egonbaren avatar Jan 21 '22 15:01 egonbaren

I think there is a problem in the component from Plain camel. I'll check it

oscerd avatar Jan 21 '22 16:01 oscerd

Also what headers are you talking about?

oscerd avatar Jan 21 '22 16:01 oscerd

Thanks @oscerd - a number of us have been working on this this week and encountered surprising behaviour where all headers were being stripped. I'll see if I can get one of the team to better express the issue than I can. Thanks for responding!

johnnyreilly avatar Jan 21 '22 18:01 johnnyreilly

I'll have a look next week. I guess there is something in the component but need to double check. If you have example of record coming from Kafka, please post it

oscerd avatar Jan 21 '22 19:01 oscerd

Thanks @oscerd - will see what we can do!

johnnyreilly avatar Jan 21 '22 20:01 johnnyreilly

Here is an example of a message + headers, formatted with kcat:

Key (-1 bytes):
  Value (141 bytes): {"CorrelationId":"a529A3D7-e15f-3d21e-315t6r5-e54csda23dbadQwfh3a1","Message":"Example","Timestamp":"2022-01-22T17:19:43.459939+00:00"}
  Headers: 
  Digest=U0hBLTUxMi8yNTY9dTkAocasnkjzvASOfuqnfsoiuds87101jsmNiTGQ2YUdFWT0=,
  Signature-Input=bW9uZXNNcaiuhasfhASIUWqosidfachsuczkjxvnduaW5nLWtleS0xIg==,
  Signature=bW9uZAkjanscavbchjzxbchbauysfwqoaicocxjaoDRvRFFyeXhURDJJklghyu6==

Doug-North avatar Jan 22 '22 07:01 Doug-North

Thanks. I'll take a look next week

oscerd avatar Jan 22 '22 07:01 oscerd

At first sight it seems we aren't taking care of the headers in the component producer.

https://github.com/apache/camel/blob/camel-3.14.0/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/operations/EventHubsProducerOperations.java#L140

This is something we need to double check. But, there is no mapping between Camel headers and EventData object properties field.

oscerd avatar Jan 24 '22 12:01 oscerd

https://issues.apache.org/jira/browse/CAMEL-17543

oscerd avatar Jan 24 '22 12:01 oscerd

To make them pass you should prepend "CamelHeader." to your header name. In that way you should see them routing, but the problem on the component remains.

oscerd avatar Feb 02 '22 13:02 oscerd

Here is an example of a message + headers, formatted with kcat:

Key (-1 bytes):
  Value (141 bytes): {"CorrelationId":"a529A3D7-e15f-3d21e-315t6r5-e54csda23dbadQwfh3a1","Message":"Example","Timestamp":"2022-01-22T17:19:43.459939+00:00"}
  Headers: 
  Digest=U0hBLTUxMi8yNTY9dTkAocasnkjzvASOfuqnfsoiuds87101jsmNiTGQ2YUdFWT0=,
  Signature-Input=bW9uZXNNcaiuhasfhASIUWqosidfachsuczkjxvnduaW5nLWtleS0xIg==,
  Signature=bW9uZAkjanscavbchjzxbchbauysfwqoaicocxjaoDRvRFFyeXhURDJJklghyu6==

@Doug-North @johnnyreilly so if the above is an example of message sent to the sink connector those headers should be called: CamelHeader.Digest, CamelHeader.Signature-Input and CamelHeader.Signature.

Would be nice if you could try with those names and see what happens.

valdar avatar Feb 02 '22 17:02 valdar

The component has been fixed by the way.

oscerd avatar Feb 02 '22 17:02 oscerd