[
https://issues.apache.org/jira/browse/CAMEL-16628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507055#comment-17507055
]
Nicolas Filotto commented on CAMEL-16628:
-----------------------------------------
[~davsclaus] I started to propagate what has been done within the context of
this ticket to the existing components and I faced a complex use case with the
component `camel-atomix` that contains several endpoints (map, messaging,
multimap, queue, set, value).
Those endpoints share headers but in a complex way, as you can see below:
+all+
* RESOURCE_ACTION_HAS_RESULT
* RESOURCE_NAME
* RESOURCE_VALUE
+map and value+
* RESOURCE_OLD_VALUE
+map and multimap+
* RESOURCE_KEY
+map, queue, set and value+
* EVENT_TYPE
+map, multimap, set and value+
* RESOURCE_TTL
+map, multimap, queue, set and value+
* RESOURCE_READ_CONSISTENCY
+map only+
* RESOURCE_DEFAULT_VALUE
+messaging only+
* MESSAGE_ID
* MEMBER_NAME
* CHANNEL_NAME
* BROADCAST_TYPE
With the existing code, the only way to do that is to replace the existing
class that contains all the headers called `AtomixClientConstants` by a
Constants class for each endpoint and duplicate common constants/headers with
their metadata.
Unless we consider that duplicating the common constants/headers with their
metadata is acceptable, I believe that the existing code needs to be improved
to properly address this kind of use case, don't you agree?
What I first proposed could manage this kind of use case as we provided the
list of header names for each end point but maybe you have a better way to
manage it?
> camel-core - SPI annotations for message headers
> ------------------------------------------------
>
> Key: CAMEL-16628
> URL: https://issues.apache.org/jira/browse/CAMEL-16628
> Project: Camel
> Issue Type: New Feature
> Components: build system, camel-core
> Reporter: Claus Ibsen
> Assignee: Nicolas Filotto
> Priority: Major
> Fix For: 3.16.0
>
>
> Like we have for endpoint options with @UriParam, we should have a new SPI
> annotation to markup headers that consumer/producers support.
> This allows us to generate that information into the component json file for
> tooling support, and also to generate this in the website documentation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)