diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json index 6f2191314ef8a..5cfc327da43e3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bean.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, + "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } + }, "properties": { "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/browse.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/browse.json index 42301919f4bae..26741290eef90 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/browse.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/browse.json @@ -30,6 +30,11 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "browseLimit": { "index": 3, "kind": "property", "displayName": "Browse Limit", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of messages to keep in memory available for browsing. Use 0 for unlimited." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unchanged" ], "description": "The body the producer sent: the route runs on the same exchange, in the thread of the producer" }, + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged, unless a route consumes from the same browse endpoint: it runs on the same exchange, so the body is the one that route ends with" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A name which can be any string to uniquely identify the endpoint" }, "bridgeErrorHandler": { "index": 1, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json index 211171c616b1c..27b67ef9d27e7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/class.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, + "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } + }, "properties": { "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/controlbus.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/controlbus.json index b079ee3b3ad6c..c50a568dc631d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/controlbus.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/controlbus.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "byOption": [ { "option": "command", "value": "language", "carriers": [ "text", "bytes", "stream", "file" ] } ], "description": "The route actions do not read the body. The language command evaluates the body as its expression, as text" }, + "producerOut": { "carriers": [ "unchanged" ], "byOption": [ { "option": "action", "value": "status", "carriers": [ "text", "unchanged" ] }, { "option": "action", "value": "stats", "carriers": [ "text", "unchanged" ] }, { "option": "command", "value": "language", "carriers": [ "unknown" ] }, { "option": "async", "value": "true", "carriers": [ "unchanged" ] } ], "description": "The status of the route for action=status, such as Started, and its statistics as XML for action=stats; the result of the expression for the language command. The other actions leave the body unchanged, as does async=true or a task that fails, which is only logged" } + }, "properties": { "command": { "index": 0, "kind": "path", "displayName": "Command", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "route", "language" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Command can be either route or language" }, "language": { "index": 1, "kind": "path", "displayName": "Language", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.Language", "enum": [ "bean", "constant", "datasonnet", "exchangeProperty", "file", "groovy", "header", "hl7terser", "java", "joor", "jq", "jsonpath", "mvel", "ognl", "python", "ref", "simple", "spel", "tokenize", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Allows you to specify the name of a Language to use for evaluating the message body. If there is any result from the evaluation, then the result is put in the message body." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataformat.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataformat.json index 2f5cef8d00251..779f4c12753d9 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataformat.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataformat.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body the data format named in the path takes, as for the marshal and unmarshal EIPs" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the data format named in the path gives, as for the marshal and unmarshal EIPs" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of data format" }, "operation": { "index": 1, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "marshal", "unmarshal" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to use either marshal or unmarshal" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset-test.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset-test.json index 2ff48ddf0665e..4fce48833c4fd 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset-test.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset-test.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "To use a custom ExchangeFormatter to format the Exchange into a String suitable for logging." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "Each message is compared with the next body read at startup from the endpoint in the name. A mismatch fails the assertions of the endpoint, not the message" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of endpoint to lookup in the registry to use for polling messages used for testing" }, "anyOrder": { "index": 1, "kind": "parameter", "displayName": "Any Order", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the expected messages should arrive in the same order or can be in any order." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset.json index 605527e92460f..ce8187b4f9f39 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dataset.json @@ -33,6 +33,11 @@ "headers": { "CamelDataSetIndex": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The dataset index", "constantName": "org.apache.camel.component.dataset.DataSetConstants#DATASET_INDEX" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unknown" ], "description": "The body the DataSet bean creates for each message: the defaultBody of a SimpleDataSet (the text world!<\/hello> unless set), the bodies of a ListDataSet in turn, or the text of a FileDataSet" }, + "producerIn": { "carriers": [ "any" ], "description": "Each message is compared with the body the DataSet creates for its index. A mismatch fails the assertions of the endpoint, not the message" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.dataset.DataSet", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of DataSet to lookup in the registry" }, "dataSetIndex": { "index": 1, "kind": "parameter", "displayName": "Data Set Index", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "strict", "lenient", "off" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "lenient", "description": "Controls the behaviour of the CamelDataSetIndex header. off (consumer) the header will not be set. strict (consumer) the header will be set. lenient (consumer) the header will be set. off (producer) the header value will not be verified, and will not be set if it is not present. strict (producer) the header value must be present and will be verified. lenient (producer) the header value will be verified if it is present, and will be set if it is not present." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router-control.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router-control.json index a57cadc2accb3..ae13eadb71f68 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router-control.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router-control.json @@ -37,6 +37,10 @@ "CamelDynamicRouterPredicateBean": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the bean in the registry that identifies the subscription predicate.", "constantName": "org.apache.camel.component.dynamicrouter.control.DynamicRouterControlConstants#CONTROL_PREDICATE_BEAN" }, "CamelDynamicRouterExpressionLanguage": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The language for the predicate when supplied as a string.", "constantName": "org.apache.camel.component.dynamicrouter.control.DynamicRouterControlConstants#CONTROL_EXPRESSION_LANGUAGE" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "A DynamicRouterControlMessage, or the subscription in the options or the headers. For subscribe and update without a predicate or a predicateBean, the body must be the Predicate" }, + "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "controlAction", "value": "subscribe", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "update", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "unsubscribe", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "controlAction", "value": "list", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "statistics", "carriers": [ "text" ], "javaType": "java.lang.String" } ], "description": "By the action: the id of the subscription for subscribe and update, true when unsubscribe removed it, and the subscriptions or their statistics as text for list and statistics. The CamelDynamicRouterControlAction header overrides the action" } + }, "properties": { "controlAction": { "index": 0, "kind": "path", "displayName": "Control Action", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "subscribe", "unsubscribe", "update", "list", "statistics" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Control action" }, "lazyStartProducer": { "index": 1, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router.json index 68b9b5dc6f5d8..9328124d78591 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dynamic-router.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The message to route: the predicates of the subscriptions on the channel decide where it goes" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the recipient ends with; with allMatch, the one of the last recipient unless an aggregationStrategy is set. When no subscription matches, a text that says so, with the body in the originalBody header" } + }, "properties": { "channel": { "index": 0, "kind": "path", "displayName": "Channel", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Channel for the Dynamic Router. For example, if the Dynamic Router URI is dynamic-router:\/\/test, then the channel is test. Channels are a way of keeping routing participants, their rules, and exchanges logically separate from the participants, rules, and exchanges on other channels. This can be seen as analogous to VLANs in networking." }, "aggregationStrategy": { "index": 1, "kind": "parameter", "displayName": "Aggregation Strategy", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dynamicrouter.routing.DynamicRouterConfiguration", "configurationField": "configuration", "description": "Refers to an AggregationStrategy to be used to assemble the replies from the multicasts, into a single outgoing message from the Multicast. By default, Camel will use the last reply as the outgoing message. You can also use a POJO as the AggregationStrategy." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/event.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/event.json index ddac6dc0bb66d..4fa8339122c15 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/event.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/event.json @@ -40,6 +40,9 @@ "CamelEventRedeliveryAttempt": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The redelivery attempt number (for ExchangeRedelivery events)", "constantName": "org.apache.camel.component.camelevent.CamelEventConstants#HEADER_EVENT_REDELIVERY_ATTEMPT" }, "CamelEventBatchSize": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of events in a batch (only set when batchSize is configured)", "constantName": "org.apache.camel.component.camelevent.CamelEventConstants#HEADER_EVENT_BATCH_SIZE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.spi.CamelEvent", "dependsOn": [ "batchSize" ], "description": "The event, such as a RouteStartedEvent or an ExchangeCompletedEvent. With a batchSize above 1, a List of the events" } + }, "properties": { "events": { "index": 0, "kind": "path", "displayName": "Events", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Comma-separated list of event types to subscribe to. Event types correspond to CamelEvent.Type enum values (case-insensitive), for example: RouteStarted, RouteStopped, ExchangeCompleted, ExchangeFailed. Wildcard patterns are supported using a suffix, for example: Route matches all route events, Exchange matches all exchange events, and matches all events." }, "async": { "index": 1, "kind": "parameter", "displayName": "Async", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to process events asynchronously using a thread pool. When enabled, the event notifier thread is not blocked while the event exchange is processed. Use asyncPoolSize to control the maximum number of concurrent event processing threads." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/exec.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/exec.json index 06aea47ab0db6..633ae01e4b135 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/exec.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/exec.json @@ -44,6 +44,10 @@ "CamelExecUseStderrOnEmptyStdout": { "index": 8, "kind": "header", "displayName": "", "group": "in", "label": "in", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates that when stdout is empty, this component will populate the Camel Message Body with stderr. This behavior is disabled (false) by default. Requires allowControlHeaders=true on the exec endpoint or component (default is false since Camel 4.20).", "constantName": "org.apache.camel.component.exec.ExecBinding#EXEC_USE_STDERR_ON_EMPTY_STDOUT" }, "CamelExecCommandLogLevel": { "index": 9, "kind": "header", "displayName": "", "group": "in", "label": "in", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Logging level to be used for commands during execution. The default value is DEBUG. Possible values are TRACE, DEBUG, INFO, WARN, ERROR or OFF (Values of LoggingLevel enum). Requires allowControlHeaders=true on the exec endpoint or component (default is false since Camel 4.20).", "constantName": "org.apache.camel.component.exec.ExecBinding#EXEC_COMMAND_LOG_LEVEL" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The standard input of the command, when the body converts to a stream: text, bytes, a stream or a file. Another body, or no body, runs the command without input" }, + "producerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.exec.ExecResult", "dependsOn": [ "binding" ], "description": "The ExecResult, with the exit value and the standard error in headers. It converts to the text, bytes or stream of the standard output, of the outFile when set, or of the standard error with useStderrOnEmptyStdout" } + }, "properties": { "executable": { "index": 0, "kind": "path", "displayName": "Executable", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the executable to be executed. The executable must not be empty or null." }, "args": { "index": 1, "kind": "parameter", "displayName": "Args", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The arguments may be one or many whitespace-separated tokens." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/knative.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/knative.json index 4cd67395d5cb1..2570eea62af00 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/knative.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/knative.json @@ -59,6 +59,12 @@ "CamelCloudEventSubject": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The subject of the event in the context of the event source.", "constantName": "org.apache.camel.component.knative.KnativeConstants#CLOUD_EVENT_SUBJECT" }, "CamelCloudEventTime": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The time the event occurred. The producer uses the exchange creation time when not set.", "constantName": "org.apache.camel.component.knative.KnativeConstants#CLOUD_EVENT_TIME" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "bytes", "null", "map", "list", "text", "value" ], "description": "The data of the event as a byte array, empty or null for an event without data. A structured event (Content-Type application\/cloudevents+json) gives its data field parsed from JSON: a Map, a List, text or a value" }, + "consumerReply": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "byOption": [ { "option": "reply", "value": "false", "carriers": [ "any" ] } ], "description": "The data of the reply, sent as bytes: text, bytes, a stream or a file; no body answers 204 No Content. A Map or a POJO fails: marshal it first. With reply=false the body is not sent" }, + "producerIn": { "carriers": [ "text", "bytes", "stream", "file" ], "description": "The data of the event: text, bytes, a stream or a file, sent as bytes. No body fails, and so does a Map or a POJO: marshal it first" }, + "producerOut": { "carriers": [ "bytes", "null" ], "description": "The body of the response, also for a message that expects no reply (InOnly): a byte array, null for a response without a body" } + }, "properties": { "type": { "index": 0, "kind": "path", "displayName": "Type", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.knative.spi.Knative.Type", "enum": [ "endpoint", "channel", "event" ], "deprecated": false, "autowired": false, "secret": false, "description": "The Knative resource type" }, "typeId": { "index": 1, "kind": "path", "displayName": "Type Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The identifier of the Knative resource" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/language.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/language.json index fb260589ad386..dcf729ff34def 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/language.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/language.json @@ -32,6 +32,10 @@ "headers": { "CamelLanguageScript": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or Expression", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The script to execute provided in the header. Takes precedence over script configured on the endpoint.", "constantName": "org.apache.camel.component.language.LanguageConstants#LANGUAGE_SCRIPT" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body as the language of the script reads it. The script is in the uri, the script option or a resource, or in the CamelLanguageScript header with allowTemplateFromHeader=true, and never in the body" }, + "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "transform", "value": "false", "carriers": [ "unchanged" ] }, { "option": "binary", "value": "true", "carriers": [ "stream" ] } ], "description": "The result of the script, as the language gives it. Unchanged with transform=false. With binary=true the content of the resource as a stream, which is not evaluated" } + }, "properties": { "languageName": { "index": 0, "kind": "path", "displayName": "Language Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "bean", "constant", "datasonnet", "exchangeProperty", "file", "groovy", "header", "hl7terser", "java", "joor", "jq", "js", "jsonpath", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "xpath", "xquery", "xtokenize" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the language to use" }, "resourceUri": { "index": 1, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource, or a reference to lookup a bean in the Registry to use as the resource" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json index 9d9a7c4b8c613..768303766ec43 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/once.json @@ -29,6 +29,9 @@ "delay": { "index": 2, "kind": "property", "displayName": "Delay", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The number of milliseconds to wait before triggering. Use 0 or negative to fire as soon as possible. The default value is 1000." }, "languages": { "index": 3, "kind": "property", "displayName": "Languages", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether Camel languages are supported such as simple,groovy." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "null" ], "dependsOn": [ "body" ], "description": "No body without the body option. The body option gives its text, the text of a file:, classpath: or http: resource, a Boolean for true or false, a number for a whole number, or with language:NAME: the result of the expression" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The logical name" }, "body": { "index": 1, "kind": "parameter", "displayName": "Body", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "The data to use as message body. You can externalize the data by using file: or classpath: as prefix and specify the location of the file." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ref.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ref.json index 2c8ab8073ccf7..93438a3abcf58 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ref.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/ref.json @@ -28,6 +28,11 @@ "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unknown" ], "description": "The body the consumer of the endpoint in the registry gives" }, + "producerIn": { "carriers": [ "any" ], "description": "The bodies the producer of the endpoint in the registry takes" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the producer of the endpoint in the registry leaves" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of endpoint to lookup in the registry." }, "bridgeErrorHandler": { "index": 1, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json index 0b170f11f2ec8..9eb5e7a75b7c9 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/rest-api.json @@ -28,6 +28,10 @@ "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or if a org.apache.camel.spi.RestApiConsumerFactory is registered in the registry. If either one is found, then that is being used." }, "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "null" ], "dependsOn": [ "consumerComponentName" ], "description": "The GET request for the API document, which has no body" }, + "consumerReply": { "carriers": [ "null", "text", "bytes", "stream" ], "dependsOn": [ "consumerComponentName" ], "description": "The API document the route of the REST DSL sets: the OpenAPI document as bytes, JSON unless the path ends with .yaml or the Accept header asks for YAML" } + }, "properties": { "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The base path" }, "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for generating the API of the REST services, such as openapi." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/saga.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/saga.json index 98e1f751e6e2b..3249b3bbba388 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/saga.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/saga.json @@ -30,6 +30,10 @@ "headers": { "Long-Running-Action": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The long running action", "constantName": "org.apache.camel.component.saga.SagaConstants#SAGA_LONG_RUNNING_ACTION" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged: the saga service calls the completion or compensation endpoints with messages of its own" } + }, "properties": { "action": { "index": 0, "kind": "path", "displayName": "Action", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.saga.SagaEndpoint.SagaEndpointAction", "enum": [ "COMPLETE", "COMPENSATE" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Action to execute (complete or compensate)" }, "lazyStartProducer": { "index": 1, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stream.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stream.json index 260f2172b9991..96e7923834b0f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stream.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stream.json @@ -32,6 +32,11 @@ "CamelStreamIndex": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The index", "constantName": "org.apache.camel.component.stream.StreamConstants#STREAM_INDEX" }, "CamelStreamComplete": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is complete", "constantName": "org.apache.camel.component.stream.StreamConstants#STREAM_COMPLETE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "dependsOn": [ "groupLines" ], "byOption": [ { "option": "readLine", "value": "false", "carriers": [ "bytes" ], "javaType": "byte[]" } ], "description": "Each line of the stream as text. With groupLines, a List of the lines; with readLine=false, all the bytes of the stream" }, + "producerIn": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "description": "Text in the encoding, or bytes, a stream or a file as bytes, followed by a new line; no body writes nothing. A Map or a POJO is written as its toString() and a List fails: marshal it first" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "kind": { "index": 0, "kind": "path", "displayName": "Kind", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "in", "out", "err", "header", "file", "http" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Kind of stream to use such as System.in, System.out, a file, or a http url." }, "encoding": { "index": 1, "kind": "parameter", "displayName": "Encoding", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "You can configure the encoding (is a charset name) to use text-based streams (for example, message body is a String object). If not provided, Camel uses the JVM default Charset." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stub.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stub.json index 889e38765279c..2aeb9bd3b00d7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stub.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stub.json @@ -38,6 +38,11 @@ "shadow": { "index": 10, "kind": "property", "displayName": "Shadow", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If shadow is enabled then the stub component will register a shadow endpoint with the actual uri that refers to the stub endpoint, meaning you can lookup the endpoint via both stub:kafka:cheese and kafka:cheese." }, "shadowPattern": { "index": 11, "kind": "property", "displayName": "Shadow Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If shadow is enabled then this pattern can be used to filter which components to match. Multiple patterns can be separated by comma." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unchanged" ], "description": "The body the producer sent" }, + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unknown" ], "description": "Unchanged when no route consumes from the stub endpoint, or for a message that expects no reply (InOnly). A message that expects one (InOut) waits for the body the stub route ends with" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of queue" }, "size": { "index": 1, "kind": "parameter", "displayName": "Size", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). Will by default use the queueSize set on the SEDA component." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/validator.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/validator.json index 8f36134aa8181..e6a59c38577e3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/validator.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/validator.json @@ -28,6 +28,10 @@ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "resourceResolverFactory": { "index": 2, "kind": "property", "displayName": "Resource Resolver Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.validator.ValidatorResourceResolverFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom LSResourceResolver which depends on a dynamic endpoint resource URI" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "headerName" ], "byOption": [ { "option": "failOnNullBody", "value": "false", "carriers": [ "null", "text", "bytes", "stream", "file", "pojo" ] } ], "description": "The XML to validate: text, bytes, a stream, a file, a DOM or another javax.xml.transform.Source. A Map, a List or no body fails; with headerName the header is validated instead" }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged: XML that is not valid fails with a SchemaValidationException" } + }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "URL to a local resource on the classpath, or a reference to lookup a bean in the Registry, or a full URL to a remote resource or resource on the file system which contains the XSD to validate against." }, "failOnNullBody": { "index": 1, "kind": "parameter", "displayName": "Fail On Null Body", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to fail if no body exists." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wasm.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wasm.json index 5bf98acf9c617..be436686faa88 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wasm.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wasm.json @@ -31,6 +31,10 @@ "CamelWasmExitCode": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exit code of the module: 0 when it returned from its _start function, otherwise the value it passed to proc_exit. Not set when the module trapped, timed out or exceeded maxOutputSize.", "constantName": "org.apache.camel.wasm.Wasm$Headers#EXIT_CODE" }, "CamelWasmStderr": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What the module wrote to its standard error, decoded as UTF-8. Not set when the module wrote nothing or timed out.", "constantName": "org.apache.camel.wasm.Wasm$Headers#STDERR" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "description": "The standard input of the module: text, bytes, a stream or a file; no body is an empty input. A Map, a List or a POJO fails: marshal it first" }, + "producerOut": { "carriers": [ "bytes" ], "javaType": "byte[]", "description": "The standard output of the module, with the exit code in the CamelWasmExitCode header" } + }, "properties": { "module": { "index": 0, "kind": "path", "displayName": "Module", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The WASI Preview 1 command module to run, as a resource: by default from the classpath, or with a prefix such as classpath:, file: or http:" }, "args": { "index": 1, "kind": "parameter", "displayName": "Args", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.wasm.WasmConfiguration", "configurationField": "configuration", "description": "The command line arguments passed to the module, separated by whitespace. Use double quotes around an argument that contains whitespace. The module receives the file name of the module (for example upper.wasm, without scheme, directories or query) as argument zero, followed by these arguments. The arguments are fixed by the route: they cannot be set from message headers." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json index 24a36d9612bf2..28cd2c8d05999 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json @@ -43,6 +43,10 @@ "CamelXsltStylesheet": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The template to use instead of the endpoint configured.", "constantName": "org.apache.camel.component.xslt.XsltConstants#XSLT_STYLESHEET" }, "CamelXsltFileName": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The XSLT file name", "constantName": "org.apache.camel.component.xslt.XsltConstants#XSLT_FILE_NAME" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source", "useJsonBody" ], "byOption": [ { "option": "failOnNullBody", "value": "false", "carriers": [ "null", "text", "bytes", "stream", "file", "pojo" ] } ], "description": "The XML to transform: text, bytes, a stream, a file, a DOM or another javax.xml.transform.Source; JSON text with useJsonBody. A Map, a List or no body fails" }, + "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "dependsOn": [ "resultHandlerFactory" ], "byOption": [ { "option": "output", "value": "bytes", "carriers": [ "bytes" ], "javaType": "byte[]" }, { "option": "output", "value": "DOM", "carriers": [ "pojo" ], "javaType": "org.w3c.dom.Document" }, { "option": "output", "value": "file", "carriers": [ "file" ], "javaType": "java.io.File" } ], "description": "The result of the transformation" } + }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod" }, "allowStAX": { "index": 1, "kind": "parameter", "displayName": "Allow StAX", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/browse-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/browse-component.adoc index 38f0524389619..cb5dee59edc9d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/browse-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/browse-component.adoc @@ -85,7 +85,7 @@ public void inspectReceivedOrders() { // then we can inspect the list of received exchanges from Java for (Exchange exchange : exchanges) { - String payload = exchange.getIn().getBody(); + String payload = exchange.getIn().getBody(String.class); // do something with payload } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-component.adoc index aa41b69fe2740..42b8a9ef640eb 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-component.adoc @@ -77,8 +77,8 @@ data set, and provides some useful features to derived classes. |=== |Property |Type |Default |Description -|`defaultHeaders` |`Map` |`null` | Specify the default message body. -For `SimpleDataSet` it is a constant payload; though if you want to create custom payloads per message, +|`defaultHeaders` |`Map` |`null` | Specify the default message headers. +They are the same for each message; though if you want to create custom headers per message, create your own derivation of `DataSetSupport`. |`outputTransformer` |`org.apache.camel.Processor` |null | diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/exec-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/exec-component.adoc index 64ca34aae1f84..31f392b31036e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/exec-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/exec-component.adoc @@ -97,7 +97,7 @@ executable via its standard input (`stdin`). After execution, http://camel.apache.org/exchange.html[the message body] is the result of the execution. -That is, an `org.apache.camel.components.exec.ExecResult` instance containing the +That is, an `org.apache.camel.component.exec.ExecResult` instance containing the `stdout`, `stderr`, _exit value_, and the _out file_. This component supports the following `ExecResult` http://camel.apache.org/type-converter.html[type converters] @@ -305,7 +305,7 @@ Java:: + [source,java] ---- -// When outFile is specified, the body is the content of that file (as InputStream) +// When outFile is specified, the ExecResult in the body converts to the content of that file from("direct:exec") .to("exec:ant.bat?args=-f CamelExecBuildFile.xml -l CamelExecOutFile.txt&outFile=CamelExecOutFile.txt") .to("log:result"); @@ -315,7 +315,7 @@ XML:: + [source,xml] ---- - + @@ -327,7 +327,7 @@ YAML:: + [source,yaml] ---- -# When outFile is specified, the body is the content of that file (as InputStream) +# When outFile is specified, the ExecResult in the body converts to the content of that file - route: from: uri: direct:exec diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/language-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/language-component.adoc index 435519cea521f..e7753b75dc569 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/language-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/language-component.adoc @@ -131,7 +131,7 @@ Java:: [source,java] ---- from("direct:double") - .to("language:groovy:${body} * 2}"); + .to("language:groovy:body * 2"); ---- XML:: @@ -140,7 +140,7 @@ XML:: ---- - + ---- @@ -153,25 +153,26 @@ YAML:: uri: direct:double steps: - to: - uri: "language:groovy:${body} * 2}" + uri: "language:groovy:body * 2" ---- ==== -You can also provide the script as a header as shown below. Here we use +You can also provide the script as a header as shown below, when the endpoint +has `allowTemplateFromHeader=true`. Here we use xref:languages:xpath-language.adoc[XPath] language to extract the text from the `` tag. ._Java-only: providing the script as a message header_ [source,java] ---- -Object out = producer.requestBodyAndHeader("language:xpath", "Hello World", Exchange.LANGUAGE_SCRIPT, "/foo/text()"); +Object out = producer.requestBodyAndHeader("language:xpath?allowTemplateFromHeader=true", "Hello World", Exchange.LANGUAGE_SCRIPT, "/foo/text()"); assertEquals("Hello World", out); ---- == Loading scripts from resources You can specify a resource uri for a script to load in either the -endpoint uri, or in the `Exchange.LANGUAGE_SCRIPT` header. +endpoint uri, or in the `Exchange.LANGUAGE_SCRIPT` header (with `allowTemplateFromHeader=true`). The uri must start with one of the following schemes: `file:`, `classpath:`, or `http:` [tabs] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/once-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/once-component.adoc index da5b467808ba0..0587dcfad165f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/once-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/once-component.adoc @@ -227,7 +227,7 @@ Java:: + [source,java] ---- -from("once:foo?body=file.data.json&delay=-1").to("bean:myBean?method=someMethodName"); +from("once:foo?body=file:data.json&delay=-1").to("bean:myBean?method=someMethodName"); ---- XML:: @@ -235,7 +235,7 @@ XML:: [source,xml] ---- - + ---- @@ -248,7 +248,7 @@ YAML:: from: uri: once:foo parameters: - body: file.data.json + body: file:data.json delay: -1 steps: - to: diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stream-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stream-component.adoc index 706f831209ba6..829eff3eec51c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stream-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stream-component.adoc @@ -56,15 +56,14 @@ include::partial$component-endpoint-headers.adoc[] === Message content -The Stream component supports either `String` or `byte[]` for writing -to streams. Just add either `String` or `byte[]` content to the -`message.in.body`. Messages sent to the *stream:* producer in binary -mode are not followed by the newline character (as opposed to the -`String` messages). Message with `null` body will not be appended to the -output stream. + +The Stream component writes text, bytes, a stream or a file: text in the +`encoding`, and the others as bytes, each followed by a new line unless +`appendNewLine` is `false`. A message with a `null` body writes nothing. +Another body, such as a `Map`, is written as its `toString()`, so marshal it +first. + The special `stream:header` URI is used for custom output streams. Just add a `java.io.OutputStream` object to `message.in.header` in the key -`header`. + +`stream`. + See samples for an example. == Examples diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/bean.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/bean.json index af64fdd9106f3..2324355c75a40 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/bean.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/bean.json @@ -15,6 +15,10 @@ "modelName": "method", "modelJavaType": "org.apache.camel.model.language.MethodCallExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "What the method returns; null for a void method" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "ref": { "index": 1, "kind": "attribute", "displayName": "Ref", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to an existing bean (bean id) to lookup in the registry." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/exchangeProperty.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/exchangeProperty.json index 30237a2819e4b..2dc10609366d5 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/exchangeProperty.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/exchangeProperty.json @@ -15,6 +15,9 @@ "modelName": "exchangeProperty", "modelJavaType": "org.apache.camel.model.language.ExchangePropertyExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the exchange property as it is, null when there is none" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/file.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/file.json index 1e33e6ba029e5..f74414f152834 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/file.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/file.json @@ -15,6 +15,10 @@ "modelName": "simple", "modelJavaType": "org.apache.camel.model.language.SimpleExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "The body as it is, for ${body}: the file functions read the headers the file consumers set" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "A text with functions gives text, such as a file name. A single function gives its value as it is: ${file:size}, ${file:length} and ${file:modified} a Long, ${file:absolute} a Boolean, the other file functions text, and null without the headers of a file" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/header.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/header.json index d295131eba167..a1e7e1255788b 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/header.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/header.json @@ -15,6 +15,9 @@ "modelName": "header", "modelJavaType": "org.apache.camel.model.language.HeaderExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the header as it is, null when there is none. A missing header falls back to the exchange property of that name" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/jq.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/jq.json index 781f11d2f1794..64157b0b27cfc 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/jq.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/jq.json @@ -16,7 +16,7 @@ "modelJavaType": "org.apache.camel.model.language.JqExpression" }, "bodyTypes": { - "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "map" ], "format": "json", "description": "JSON as text, bytes, a stream or a file, or a Map" }, + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "map" ], "format": "json", "dependsOn": [ "source" ], "description": "JSON as text, bytes, a stream or a file, or a Map" }, "expressionOut": { "carriers": [ "pojo", "list", "null" ], "dependsOn": [ "resultType" ], "description": "A JsonNode; a List of JsonNode when the filter gives several, null when it gives none" } }, "properties": { diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/ref.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/ref.json index dcd78c00bc00f..18e2d383e0732 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/ref.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/ref.json @@ -15,6 +15,10 @@ "modelName": "ref", "modelJavaType": "org.apache.camel.model.language.RefExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "As the expression or the predicate in the registry reads it" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "What the expression in the registry returns; a Boolean for a predicate" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/tokenize.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/tokenize.json index 401f57fd5eba4..16dbce3bee17e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/tokenize.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/tokenize.json @@ -15,6 +15,10 @@ "modelName": "tokenize", "modelJavaType": "org.apache.camel.model.language.TokenizerExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file" ], "dependsOn": [ "source" ], "description": "Text as text, bytes, a stream or a file. Another body is tokenized as its toString(), and fails with endToken or xml: marshal it first" }, + "expressionOut": { "carriers": [ "iterator" ], "description": "An Iterator of the tokens as text, read once: in setBody the body is the Iterator, for the Split EIP to walk. With group, each N tokens are joined into one text" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "token": { "index": 1, "kind": "attribute", "displayName": "Token", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The (start) token to use as tokenizer, for example you can use the new line token. You can use simple language as the token to support dynamic tokens." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/variable.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/variable.json index 73b49502e5e8f..1700bbf3b51f6 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/variable.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/variable.json @@ -15,6 +15,9 @@ "modelName": "variable", "modelJavaType": "org.apache.camel.model.language.VariableExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the variable as it is, null when there is none. A global: or route: prefix reads a global or a route variable" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xpath.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xpath.json index e7e50b9357a1e..052b58d798f56 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xpath.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xpath.json @@ -16,7 +16,7 @@ "modelJavaType": "org.apache.camel.model.language.XPathExpression" }, "bodyTypes": { - "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "description": "XML as text, bytes, a stream or a file, or a DOM" }, + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source" ], "description": "XML as text, bytes, a stream or a file, or a DOM" }, "expressionOut": { "carriers": [ "pojo" ], "javaType": "org.w3c.dom.NodeList", "dependsOn": [ "resultType" ], "byOption": [ { "option": "resultQName", "value": "STRING", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "resultQName", "value": "NUMBER", "carriers": [ "value" ], "javaType": "java.lang.Double" }, { "option": "resultQName", "value": "BOOLEAN", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "resultQName", "value": "NODE", "carriers": [ "pojo" ], "javaType": "org.w3c.dom.Node" } ], "description": "The nodes the expression selects" } }, "properties": { diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xtokenize.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xtokenize.json index d9a63ad907f51..b065c75e73731 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xtokenize.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/xtokenize.json @@ -15,6 +15,10 @@ "modelName": "xtokenize", "modelJavaType": "org.apache.camel.model.language.XMLTokenizerExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source" ], "description": "XML as text, bytes, a stream or a file, or a DOM" }, + "expressionOut": { "carriers": [ "iterator" ], "description": "An Iterator of the elements the path matches as XML text, read once; mode t gives their text. With group, each N elements are joined into one text" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json index 6f2191314ef8a..5cfc327da43e3 100644 --- a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json +++ b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/bean/bean.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, + "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } + }, "properties": { "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, diff --git a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json index 211171c616b1c..27b67ef9d27e7 100644 --- a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json +++ b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/component/beanclass/class.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "beanInfoCacheSize": { "index": 3, "kind": "property", "displayName": "Bean Info Cache Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type: a String parameter gets a Map or a POJO as its toString(), so marshal it first" }, + "producerOut": { "carriers": [ "unknown" ], "description": "What the method returns, also when it returns null. A void method leaves the body unchanged" } + }, "properties": { "beanName": { "index": 0, "kind": "path", "displayName": "Bean Name", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the bean to invoke" }, "method": { "index": 1, "kind": "parameter", "displayName": "Method", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of the method to invoke on the bean" }, diff --git a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/language/bean/bean.json b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/language/bean/bean.json index af64fdd9106f3..2324355c75a40 100644 --- a/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/language/bean/bean.json +++ b/components/camel-bean/src/generated/resources/META-INF/org/apache/camel/language/bean/bean.json @@ -15,6 +15,10 @@ "modelName": "method", "modelJavaType": "org.apache.camel.model.language.MethodCallExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "The first parameter of the method gets the body, converted to its type" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "What the method returns; null for a void method" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "ref": { "index": 1, "kind": "attribute", "displayName": "Ref", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to an existing bean (bean id) to lookup in the registry." }, diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java index 5817138bf2f9d..be382ee6411c1 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java @@ -25,6 +25,9 @@ import org.apache.camel.ExchangePattern; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -37,6 +40,13 @@ */ @UriEndpoint(firstVersion = "1.0.0", scheme = "bean", title = "Bean", syntax = "bean:beanName", producerOnly = true, remote = false, category = { Category.CORE, Category.SCRIPT }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The first parameter of the method gets the body, converted to its type: a" + + " String parameter gets a Map or a POJO as its toString(), so marshal it" + + " first"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "What the method returns, also when it returns null. A void method leaves" + + " the body unchanged")) public class BeanEndpoint extends DefaultEndpoint { private transient BeanHolder beanHolder; private transient BeanProcessor processor; diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java b/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java index f00b922d4ef76..0983f49a4d083 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java +++ b/components/camel-bean/src/main/java/org/apache/camel/component/beanclass/ClassEndpoint.java @@ -19,6 +19,9 @@ import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.component.bean.BeanEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; /** @@ -26,6 +29,13 @@ */ @UriEndpoint(firstVersion = "2.4.0", scheme = "class", title = "Class", syntax = "class:beanName", producerOnly = true, remote = false, category = { Category.CORE, Category.SCRIPT }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The first parameter of the method gets the body, converted to its type: a" + + " String parameter gets a Map or a POJO as its toString(), so marshal it" + + " first"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "What the method returns, also when it returns null. A void method leaves" + + " the body unchanged")) public class ClassEndpoint extends BeanEndpoint { public ClassEndpoint(String endpointUri, Component component) { diff --git a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java index b87aa0b53025d..ef566d0bc63e5 100644 --- a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java +++ b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java @@ -35,6 +35,9 @@ import org.apache.camel.component.bean.MethodNotFoundException; import org.apache.camel.component.bean.ParameterMappingStrategy; import org.apache.camel.component.bean.ParameterMappingStrategyHelper; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Language; import org.apache.camel.spi.PropertyConfigurer; import org.apache.camel.spi.ScriptingLanguage; @@ -57,6 +60,9 @@ * As of Camel 1.5 the bean language also supports invoking a provided bean by its classname or the bean itself. */ @org.apache.camel.spi.annotations.Language("bean") +@BodyTypes(expressionIn = @BodyType(value = Carrier.ANY, + description = "The first parameter of the method gets the body, converted to its type"), + expressionOut = @BodyType(value = Carrier.UNKNOWN, description = "What the method returns; null for a void method")) public class BeanLanguage extends TypedLanguageSupport implements ScriptingLanguage, PropertyConfigurer, StaticService { public static final String LANGUAGE = "bean"; diff --git a/components/camel-browse/src/generated/resources/META-INF/org/apache/camel/component/browse/browse.json b/components/camel-browse/src/generated/resources/META-INF/org/apache/camel/component/browse/browse.json index 42301919f4bae..26741290eef90 100644 --- a/components/camel-browse/src/generated/resources/META-INF/org/apache/camel/component/browse/browse.json +++ b/components/camel-browse/src/generated/resources/META-INF/org/apache/camel/component/browse/browse.json @@ -30,6 +30,11 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "browseLimit": { "index": 3, "kind": "property", "displayName": "Browse Limit", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of messages to keep in memory available for browsing. Use 0 for unlimited." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unchanged" ], "description": "The body the producer sent: the route runs on the same exchange, in the thread of the producer" }, + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged, unless a route consumes from the same browse endpoint: it runs on the same exchange, so the body is the one that route ends with" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A name which can be any string to uniquely identify the endpoint" }, "bridgeErrorHandler": { "index": 1, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/components/camel-browse/src/main/docs/browse-component.adoc b/components/camel-browse/src/main/docs/browse-component.adoc index 38f0524389619..cb5dee59edc9d 100644 --- a/components/camel-browse/src/main/docs/browse-component.adoc +++ b/components/camel-browse/src/main/docs/browse-component.adoc @@ -85,7 +85,7 @@ public void inspectReceivedOrders() { // then we can inspect the list of received exchanges from Java for (Exchange exchange : exchanges) { - String payload = exchange.getIn().getBody(); + String payload = exchange.getIn().getBody(String.class); // do something with payload } } diff --git a/components/camel-browse/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java b/components/camel-browse/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java index 35e842ba0eee4..d76af504e63e2 100644 --- a/components/camel-browse/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java +++ b/components/camel-browse/src/main/java/org/apache/camel/component/browse/BrowseEndpoint.java @@ -28,6 +28,9 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.BrowsableEndpoint; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -45,6 +48,13 @@ */ @UriEndpoint(firstVersion = "1.3.0", scheme = "browse", title = "Browse", syntax = "browse:name", remote = false, internal = true, category = { Category.CORE, Category.MONITORING }) +@BodyTypes(consumerOut = @BodyType(value = Carrier.UNCHANGED, + description = "The body the producer sent: the route runs on the same exchange, in the" + + " thread of the producer"), + producerIn = @BodyType(Carrier.ANY), + producerOut = @BodyType(value = Carrier.UNCHANGED, + description = "Unchanged, unless a route consumes from the same browse endpoint: it runs on" + + " the same exchange, so the body is the one that route ends with")) public class BrowseEndpoint extends DefaultEndpoint implements BrowsableEndpoint { @UriPath(description = "A name which can be any string to uniquely identify the endpoint") diff --git a/components/camel-controlbus/src/generated/resources/META-INF/org/apache/camel/component/controlbus/controlbus.json b/components/camel-controlbus/src/generated/resources/META-INF/org/apache/camel/component/controlbus/controlbus.json index b079ee3b3ad6c..c50a568dc631d 100644 --- a/components/camel-controlbus/src/generated/resources/META-INF/org/apache/camel/component/controlbus/controlbus.json +++ b/components/camel-controlbus/src/generated/resources/META-INF/org/apache/camel/component/controlbus/controlbus.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "byOption": [ { "option": "command", "value": "language", "carriers": [ "text", "bytes", "stream", "file" ] } ], "description": "The route actions do not read the body. The language command evaluates the body as its expression, as text" }, + "producerOut": { "carriers": [ "unchanged" ], "byOption": [ { "option": "action", "value": "status", "carriers": [ "text", "unchanged" ] }, { "option": "action", "value": "stats", "carriers": [ "text", "unchanged" ] }, { "option": "command", "value": "language", "carriers": [ "unknown" ] }, { "option": "async", "value": "true", "carriers": [ "unchanged" ] } ], "description": "The status of the route for action=status, such as Started, and its statistics as XML for action=stats; the result of the expression for the language command. The other actions leave the body unchanged, as does async=true or a task that fails, which is only logged" } + }, "properties": { "command": { "index": 0, "kind": "path", "displayName": "Command", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "route", "language" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Command can be either route or language" }, "language": { "index": 1, "kind": "path", "displayName": "Language", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.spi.Language", "enum": [ "bean", "constant", "datasonnet", "exchangeProperty", "file", "groovy", "header", "hl7terser", "java", "joor", "jq", "jsonpath", "mvel", "ognl", "python", "ref", "simple", "spel", "tokenize", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Allows you to specify the name of a Language to use for evaluating the message body. If there is any result from the evaluation, then the result is put in the message body." }, diff --git a/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java b/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java index 07b0af743dc84..9991e90109df0 100644 --- a/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java +++ b/components/camel-controlbus/src/main/java/org/apache/camel/component/controlbus/ControlBusEndpoint.java @@ -23,6 +23,9 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.CamelLogger; import org.apache.camel.spi.Language; import org.apache.camel.spi.Metadata; @@ -39,6 +42,25 @@ */ @UriEndpoint(firstVersion = "2.11.0", scheme = "controlbus", title = "Control Bus", syntax = "controlbus:command:language", remote = false, producerOnly = true, category = { Category.CORE, Category.MONITORING }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + byOption = @BodyType.When(option = "command", value = "language", + carriers = { + Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, + Carrier.FILE }), + description = "The route actions do not read the body. The language command evaluates the" + + " body as its expression, as text"), + producerOut = @BodyType(value = Carrier.UNCHANGED, + byOption = { + @BodyType.When(option = "action", value = "status", + carriers = { Carrier.TEXT, Carrier.UNCHANGED }), + @BodyType.When(option = "action", value = "stats", + carriers = { Carrier.TEXT, Carrier.UNCHANGED }), + @BodyType.When(option = "command", value = "language", carriers = Carrier.UNKNOWN), + @BodyType.When(option = "async", value = "true", carriers = Carrier.UNCHANGED) }, + description = "The status of the route for action=status, such as Started, and its" + + " statistics as XML for action=stats; the result of the expression for the" + + " language command. The other actions leave the body unchanged, as does" + + " async=true or a task that fails, which is only logged")) public class ControlBusEndpoint extends DefaultEndpoint { @UriPath(description = "Command can be either route or language", enums = "route,language") diff --git a/components/camel-dataformat/src/generated/resources/META-INF/org/apache/camel/component/dataformat/dataformat.json b/components/camel-dataformat/src/generated/resources/META-INF/org/apache/camel/component/dataformat/dataformat.json index 2f5cef8d00251..779f4c12753d9 100644 --- a/components/camel-dataformat/src/generated/resources/META-INF/org/apache/camel/component/dataformat/dataformat.json +++ b/components/camel-dataformat/src/generated/resources/META-INF/org/apache/camel/component/dataformat/dataformat.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body the data format named in the path takes, as for the marshal and unmarshal EIPs" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the data format named in the path gives, as for the marshal and unmarshal EIPs" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of data format" }, "operation": { "index": 1, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "marshal", "unmarshal" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Operation to use either marshal or unmarshal" }, diff --git a/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java b/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java index 45d03fc6f3b98..58b943e0115d3 100644 --- a/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java +++ b/components/camel-dataformat/src/main/java/org/apache/camel/component/dataformat/DataFormatEndpoint.java @@ -24,6 +24,9 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.DataFormat; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -40,6 +43,12 @@ @UriEndpoint(firstVersion = "2.12.0", scheme = "dataformat", title = "Data Format", syntax = "dataformat:name:operation", remote = false, producerOnly = true, category = { Category.CORE, Category.TRANSFORMATION }, lenientProperties = true) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The body the data format named in the path takes, as for the marshal and" + + " unmarshal EIPs"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "The body the data format named in the path gives, as for the marshal and" + + " unmarshal EIPs")) public class DataFormatEndpoint extends DefaultEndpoint { private AsyncProcessor processor; diff --git a/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset-test.json b/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset-test.json index 2ff48ddf0665e..4fce48833c4fd 100644 --- a/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset-test.json +++ b/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset-test.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "exchangeFormatter": { "index": 3, "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "To use a custom ExchangeFormatter to format the Exchange into a String suitable for logging." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "Each message is compared with the next body read at startup from the endpoint in the name. A mismatch fails the assertions of the endpoint, not the message" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of endpoint to lookup in the registry to use for polling messages used for testing" }, "anyOrder": { "index": 1, "kind": "parameter", "displayName": "Any Order", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the expected messages should arrive in the same order or can be in any order." }, diff --git a/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset.json b/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset.json index 605527e92460f..ce8187b4f9f39 100644 --- a/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset.json +++ b/components/camel-dataset/src/generated/resources/META-INF/org/apache/camel/component/dataset/dataset.json @@ -33,6 +33,11 @@ "headers": { "CamelDataSetIndex": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The dataset index", "constantName": "org.apache.camel.component.dataset.DataSetConstants#DATASET_INDEX" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unknown" ], "description": "The body the DataSet bean creates for each message: the defaultBody of a SimpleDataSet (the text world!<\/hello> unless set), the bodies of a ListDataSet in turn, or the text of a FileDataSet" }, + "producerIn": { "carriers": [ "any" ], "description": "Each message is compared with the body the DataSet creates for its index. A mismatch fails the assertions of the endpoint, not the message" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.dataset.DataSet", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of DataSet to lookup in the registry" }, "dataSetIndex": { "index": 1, "kind": "parameter", "displayName": "Data Set Index", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "strict", "lenient", "off" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "lenient", "description": "Controls the behaviour of the CamelDataSetIndex header. off (consumer) the header will not be set. strict (consumer) the header will be set. lenient (consumer) the header will be set. off (producer) the header value will not be verified, and will not be set if it is not present. strict (producer) the header value must be present and will be verified. lenient (producer) the header value will be verified if it is present, and will be set if it is not present." }, diff --git a/components/camel-dataset/src/main/docs/dataset-component.adoc b/components/camel-dataset/src/main/docs/dataset-component.adoc index aa41b69fe2740..42b8a9ef640eb 100644 --- a/components/camel-dataset/src/main/docs/dataset-component.adoc +++ b/components/camel-dataset/src/main/docs/dataset-component.adoc @@ -77,8 +77,8 @@ data set, and provides some useful features to derived classes. |=== |Property |Type |Default |Description -|`defaultHeaders` |`Map` |`null` | Specify the default message body. -For `SimpleDataSet` it is a constant payload; though if you want to create custom payloads per message, +|`defaultHeaders` |`Map` |`null` | Specify the default message headers. +They are the same for each message; though if you want to create custom headers per message, create your own derivation of `DataSetSupport`. |`outputTransformer` |`org.apache.camel.Processor` |null | diff --git a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java index f05140e174d21..848558c6eb59a 100644 --- a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java +++ b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetEndpoint.java @@ -27,6 +27,9 @@ import org.apache.camel.Producer; import org.apache.camel.Service; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.CamelLogger; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -48,6 +51,14 @@ @UriEndpoint(firstVersion = "1.3.0", scheme = "dataset", title = "Dataset", syntax = "dataset:name", remote = false, category = { Category.CORE, Category.TESTING }, lenientProperties = true, headersClass = DataSetConstants.class) +@BodyTypes(consumerOut = @BodyType(value = Carrier.UNKNOWN, + description = "The body the DataSet bean creates for each message: the defaultBody of a" + + " SimpleDataSet (the text world! unless set), the bodies of a" + + " ListDataSet in turn, or the text of a FileDataSet"), + producerIn = @BodyType(value = Carrier.ANY, + description = "Each message is compared with the body the DataSet creates for its index. A" + + " mismatch fails the assertions of the endpoint, not the message"), + producerOut = @BodyType(Carrier.UNCHANGED)) public class DataSetEndpoint extends MockEndpoint implements Service { private final transient Logger log; private final AtomicInteger receivedCounter = new AtomicInteger(); diff --git a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java index e14fc3a4b29d6..bd3a3bc29e58c 100644 --- a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java +++ b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java @@ -27,6 +27,9 @@ import org.apache.camel.Processor; import org.apache.camel.WrappedFile; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -46,6 +49,11 @@ */ @UriEndpoint(firstVersion = "1.3.0", scheme = "dataset-test", title = "DataSet Test", syntax = "dataset-test:name", remote = false, producerOnly = true, category = { Category.CORE, Category.TESTING }, lenientProperties = true) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "Each message is compared with the next body read at startup from the endpoint" + + " in the name. A mismatch fails the assertions of the endpoint, not the" + + " message"), + producerOut = @BodyType(Carrier.UNCHANGED)) public class DataSetTestEndpoint extends MockEndpoint { private static final Logger LOG = LoggerFactory.getLogger(DataSetTestEndpoint.class); diff --git a/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/control/dynamic-router-control.json b/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/control/dynamic-router-control.json index a57cadc2accb3..ae13eadb71f68 100644 --- a/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/control/dynamic-router-control.json +++ b/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/control/dynamic-router-control.json @@ -37,6 +37,10 @@ "CamelDynamicRouterPredicateBean": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the bean in the registry that identifies the subscription predicate.", "constantName": "org.apache.camel.component.dynamicrouter.control.DynamicRouterControlConstants#CONTROL_PREDICATE_BEAN" }, "CamelDynamicRouterExpressionLanguage": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The language for the predicate when supplied as a string.", "constantName": "org.apache.camel.component.dynamicrouter.control.DynamicRouterControlConstants#CONTROL_EXPRESSION_LANGUAGE" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "A DynamicRouterControlMessage, or the subscription in the options or the headers. For subscribe and update without a predicate or a predicateBean, the body must be the Predicate" }, + "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "controlAction", "value": "subscribe", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "update", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "unsubscribe", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "controlAction", "value": "list", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "controlAction", "value": "statistics", "carriers": [ "text" ], "javaType": "java.lang.String" } ], "description": "By the action: the id of the subscription for subscribe and update, true when unsubscribe removed it, and the subscriptions or their statistics as text for list and statistics. The CamelDynamicRouterControlAction header overrides the action" } + }, "properties": { "controlAction": { "index": 0, "kind": "path", "displayName": "Control Action", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "subscribe", "unsubscribe", "update", "list", "statistics" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Control action" }, "lazyStartProducer": { "index": 1, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, diff --git a/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/routing/dynamic-router.json b/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/routing/dynamic-router.json index 68b9b5dc6f5d8..9328124d78591 100644 --- a/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/routing/dynamic-router.json +++ b/components/camel-dynamic-router/src/generated/resources/META-INF/org/apache/camel/component/dynamicrouter/routing/dynamic-router.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The message to route: the predicates of the subscriptions on the channel decide where it goes" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the recipient ends with; with allMatch, the one of the last recipient unless an aggregationStrategy is set. When no subscription matches, a text that says so, with the body in the originalBody header" } + }, "properties": { "channel": { "index": 0, "kind": "path", "displayName": "Channel", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Channel for the Dynamic Router. For example, if the Dynamic Router URI is dynamic-router:\/\/test, then the channel is test. Channels are a way of keeping routing participants, their rules, and exchanges logically separate from the participants, rules, and exchanges on other channels. This can be seen as analogous to VLANs in networking." }, "aggregationStrategy": { "index": 1, "kind": "parameter", "displayName": "Aggregation Strategy", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dynamicrouter.routing.DynamicRouterConfiguration", "configurationField": "configuration", "description": "Refers to an AggregationStrategy to be used to assemble the replies from the multicasts, into a single outgoing message from the Multicast. By default, Camel will use the last reply as the outgoing message. You can also use a POJO as the AggregationStrategy." }, diff --git a/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/control/DynamicRouterControlEndpoint.java b/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/control/DynamicRouterControlEndpoint.java index 71c3ca372936c..1591b99baa141 100644 --- a/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/control/DynamicRouterControlEndpoint.java +++ b/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/control/DynamicRouterControlEndpoint.java @@ -28,6 +28,9 @@ import org.apache.camel.component.dynamicrouter.control.DynamicRouterControlService.DynamicRouterControlServiceFactory; import org.apache.camel.component.dynamicrouter.filter.DynamicRouterFilterService; import org.apache.camel.component.dynamicrouter.routing.DynamicRouterComponent; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -59,6 +62,26 @@ remote = false, headersClass = DynamicRouterControlConstants.class, category = { Category.MESSAGING }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "A DynamicRouterControlMessage, or the subscription in the options or the" + + " headers. For subscribe and update without a predicate or a predicateBean," + + " the body must be the Predicate"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + byOption = { + @BodyType.When(option = "controlAction", value = "subscribe", + carriers = Carrier.TEXT, javaType = "java.lang.String"), + @BodyType.When(option = "controlAction", value = "update", carriers = Carrier.TEXT, + javaType = "java.lang.String"), + @BodyType.When(option = "controlAction", value = "unsubscribe", + carriers = Carrier.VALUE, javaType = "java.lang.Boolean"), + @BodyType.When(option = "controlAction", value = "list", carriers = Carrier.TEXT, + javaType = "java.lang.String"), + @BodyType.When(option = "controlAction", value = "statistics", + carriers = Carrier.TEXT, javaType = "java.lang.String") }, + description = "By the action: the id of the subscription for subscribe and update, true" + + " when unsubscribe removed it, and the subscriptions or their statistics as" + + " text for list and statistics. The CamelDynamicRouterControlAction header" + + " overrides the action")) public class DynamicRouterControlEndpoint extends DefaultEndpoint { static final String URI_CONTROL_ACTIONS = CONTROL_ACTION_SUBSCRIBE + "," + CONTROL_ACTION_UNSUBSCRIBE + "," + diff --git a/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/routing/DynamicRouterEndpoint.java b/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/routing/DynamicRouterEndpoint.java index 3546dd6bccc41..cda0e5fc8b517 100644 --- a/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/routing/DynamicRouterEndpoint.java +++ b/components/camel-dynamic-router/src/main/java/org/apache/camel/component/dynamicrouter/routing/DynamicRouterEndpoint.java @@ -29,6 +29,9 @@ import org.apache.camel.component.dynamicrouter.routing.DynamicRouterProcessor.DynamicRouterProcessorFactory; import org.apache.camel.component.dynamicrouter.routing.DynamicRouterProducer.DynamicRouterProducerFactory; import org.apache.camel.processor.RecipientList; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; @@ -55,6 +58,13 @@ producerOnly = true, remote = false, category = { Category.MESSAGING, Category.CORE }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The message to route: the predicates of the subscriptions on the channel" + + " decide where it goes"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "The body the recipient ends with; with allMatch, the one of the last" + + " recipient unless an aggregationStrategy is set. When no subscription" + + " matches, a text that says so, with the body in the originalBody header")) public class DynamicRouterEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(DynamicRouterEndpoint.class); diff --git a/components/camel-event/src/generated/resources/META-INF/org/apache/camel/component/camelevent/event.json b/components/camel-event/src/generated/resources/META-INF/org/apache/camel/component/camelevent/event.json index ddac6dc0bb66d..4fa8339122c15 100644 --- a/components/camel-event/src/generated/resources/META-INF/org/apache/camel/component/camelevent/event.json +++ b/components/camel-event/src/generated/resources/META-INF/org/apache/camel/component/camelevent/event.json @@ -40,6 +40,9 @@ "CamelEventRedeliveryAttempt": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The redelivery attempt number (for ExchangeRedelivery events)", "constantName": "org.apache.camel.component.camelevent.CamelEventConstants#HEADER_EVENT_REDELIVERY_ATTEMPT" }, "CamelEventBatchSize": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of events in a batch (only set when batchSize is configured)", "constantName": "org.apache.camel.component.camelevent.CamelEventConstants#HEADER_EVENT_BATCH_SIZE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.spi.CamelEvent", "dependsOn": [ "batchSize" ], "description": "The event, such as a RouteStartedEvent or an ExchangeCompletedEvent. With a batchSize above 1, a List of the events" } + }, "properties": { "events": { "index": 0, "kind": "path", "displayName": "Events", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Comma-separated list of event types to subscribe to. Event types correspond to CamelEvent.Type enum values (case-insensitive), for example: RouteStarted, RouteStopped, ExchangeCompleted, ExchangeFailed. Wildcard patterns are supported using a suffix, for example: Route matches all route events, Exchange matches all exchange events, and matches all events." }, "async": { "index": 1, "kind": "parameter", "displayName": "Async", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to process events asynchronously using a thread pool. When enabled, the event notifier thread is not blocked while the event exchange is processed. Use asyncPoolSize to control the maximum number of concurrent event processing threads." }, diff --git a/components/camel-event/src/main/java/org/apache/camel/component/camelevent/CamelEventEndpoint.java b/components/camel-event/src/main/java/org/apache/camel/component/camelevent/CamelEventEndpoint.java index db7538ca95571..a0ca6ccdda9e8 100644 --- a/components/camel-event/src/main/java/org/apache/camel/component/camelevent/CamelEventEndpoint.java +++ b/components/camel-event/src/main/java/org/apache/camel/component/camelevent/CamelEventEndpoint.java @@ -28,6 +28,9 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.CamelEvent; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -49,6 +52,10 @@ consumerOnly = true, remote = false, internal = true, category = { Category.CORE, Category.MONITORING }, headersClass = CamelEventConstants.class) +@BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, javaType = "org.apache.camel.spi.CamelEvent", + dependsOn = "batchSize", + description = "The event, such as a RouteStartedEvent or an ExchangeCompletedEvent. With a" + + " batchSize above 1, a List of the events")) public class CamelEventEndpoint extends DefaultEndpoint { @UriPath(description = "Comma-separated list of event types to subscribe to." diff --git a/components/camel-exec/src/generated/resources/META-INF/org/apache/camel/component/exec/exec.json b/components/camel-exec/src/generated/resources/META-INF/org/apache/camel/component/exec/exec.json index 06aea47ab0db6..633ae01e4b135 100644 --- a/components/camel-exec/src/generated/resources/META-INF/org/apache/camel/component/exec/exec.json +++ b/components/camel-exec/src/generated/resources/META-INF/org/apache/camel/component/exec/exec.json @@ -44,6 +44,10 @@ "CamelExecUseStderrOnEmptyStdout": { "index": 8, "kind": "header", "displayName": "", "group": "in", "label": "in", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates that when stdout is empty, this component will populate the Camel Message Body with stderr. This behavior is disabled (false) by default. Requires allowControlHeaders=true on the exec endpoint or component (default is false since Camel 4.20).", "constantName": "org.apache.camel.component.exec.ExecBinding#EXEC_USE_STDERR_ON_EMPTY_STDOUT" }, "CamelExecCommandLogLevel": { "index": 9, "kind": "header", "displayName": "", "group": "in", "label": "in", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Logging level to be used for commands during execution. The default value is DEBUG. Possible values are TRACE, DEBUG, INFO, WARN, ERROR or OFF (Values of LoggingLevel enum). Requires allowControlHeaders=true on the exec endpoint or component (default is false since Camel 4.20).", "constantName": "org.apache.camel.component.exec.ExecBinding#EXEC_COMMAND_LOG_LEVEL" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The standard input of the command, when the body converts to a stream: text, bytes, a stream or a file. Another body, or no body, runs the command without input" }, + "producerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.exec.ExecResult", "dependsOn": [ "binding" ], "description": "The ExecResult, with the exit value and the standard error in headers. It converts to the text, bytes or stream of the standard output, of the outFile when set, or of the standard error with useStderrOnEmptyStdout" } + }, "properties": { "executable": { "index": 0, "kind": "path", "displayName": "Executable", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the executable to be executed. The executable must not be empty or null." }, "args": { "index": 1, "kind": "parameter", "displayName": "Args", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The arguments may be one or many whitespace-separated tokens." }, diff --git a/components/camel-exec/src/main/docs/exec-component.adoc b/components/camel-exec/src/main/docs/exec-component.adoc index 64ca34aae1f84..31f392b31036e 100644 --- a/components/camel-exec/src/main/docs/exec-component.adoc +++ b/components/camel-exec/src/main/docs/exec-component.adoc @@ -97,7 +97,7 @@ executable via its standard input (`stdin`). After execution, http://camel.apache.org/exchange.html[the message body] is the result of the execution. -That is, an `org.apache.camel.components.exec.ExecResult` instance containing the +That is, an `org.apache.camel.component.exec.ExecResult` instance containing the `stdout`, `stderr`, _exit value_, and the _out file_. This component supports the following `ExecResult` http://camel.apache.org/type-converter.html[type converters] @@ -305,7 +305,7 @@ Java:: + [source,java] ---- -// When outFile is specified, the body is the content of that file (as InputStream) +// When outFile is specified, the ExecResult in the body converts to the content of that file from("direct:exec") .to("exec:ant.bat?args=-f CamelExecBuildFile.xml -l CamelExecOutFile.txt&outFile=CamelExecOutFile.txt") .to("log:result"); @@ -315,7 +315,7 @@ XML:: + [source,xml] ---- - + @@ -327,7 +327,7 @@ YAML:: + [source,yaml] ---- -# When outFile is specified, the body is the content of that file (as InputStream) +# When outFile is specified, the ExecResult in the body converts to the content of that file - route: from: uri: direct:exec diff --git a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java index 4339c2304e5b8..e2b8378f5b437 100644 --- a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java +++ b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java @@ -21,6 +21,9 @@ import org.apache.camel.LoggingLevel; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -33,6 +36,15 @@ */ @UriEndpoint(firstVersion = "2.3.0", scheme = "exec", title = "Exec", syntax = "exec:executable", producerOnly = true, remote = false, category = { Category.CORE }, headersClass = ExecBinding.class) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The standard input of the command, when the body converts to a stream: text," + + " bytes, a stream or a file. Another body, or no body, runs the command" + + " without input"), + producerOut = @BodyType(value = Carrier.POJO, javaType = "org.apache.camel.component.exec.ExecResult", + dependsOn = "binding", + description = "The ExecResult, with the exit value and the standard error in headers. It" + + " converts to the text, bytes or stream of the standard output, of the" + + " outFile when set, or of the standard error with useStderrOnEmptyStdout")) public class ExecEndpoint extends DefaultEndpoint { /** diff --git a/components/camel-jq/src/generated/resources/META-INF/org/apache/camel/language/jq/jq.json b/components/camel-jq/src/generated/resources/META-INF/org/apache/camel/language/jq/jq.json index 781f11d2f1794..64157b0b27cfc 100644 --- a/components/camel-jq/src/generated/resources/META-INF/org/apache/camel/language/jq/jq.json +++ b/components/camel-jq/src/generated/resources/META-INF/org/apache/camel/language/jq/jq.json @@ -16,7 +16,7 @@ "modelJavaType": "org.apache.camel.model.language.JqExpression" }, "bodyTypes": { - "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "map" ], "format": "json", "description": "JSON as text, bytes, a stream or a file, or a Map" }, + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "map" ], "format": "json", "dependsOn": [ "source" ], "description": "JSON as text, bytes, a stream or a file, or a Map" }, "expressionOut": { "carriers": [ "pojo", "list", "null" ], "dependsOn": [ "resultType" ], "description": "A JsonNode; a List of JsonNode when the filter gives several, null when it gives none" } }, "properties": { diff --git a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java index 3944e84c8d266..0e84f1abd3721 100644 --- a/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java +++ b/components/camel-jq/src/main/java/org/apache/camel/language/jq/JqLanguage.java @@ -31,7 +31,8 @@ @Language("jq") @BodyTypes(expressionIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.MAP }, - format = "json", description = "JSON as text, bytes, a stream or a file, or a Map"), + format = "json", dependsOn = "source", + description = "JSON as text, bytes, a stream or a file, or a Map"), expressionOut = @BodyType(value = { Carrier.POJO, Carrier.LIST, Carrier.NULL }, dependsOn = "resultType", description = "A JsonNode; a List of JsonNode when the filter gives several, null when it" + " gives none")) diff --git a/components/camel-knative/camel-knative-component/src/generated/resources/META-INF/org/apache/camel/component/knative/knative.json b/components/camel-knative/camel-knative-component/src/generated/resources/META-INF/org/apache/camel/component/knative/knative.json index 4cd67395d5cb1..2570eea62af00 100644 --- a/components/camel-knative/camel-knative-component/src/generated/resources/META-INF/org/apache/camel/component/knative/knative.json +++ b/components/camel-knative/camel-knative-component/src/generated/resources/META-INF/org/apache/camel/component/knative/knative.json @@ -59,6 +59,12 @@ "CamelCloudEventSubject": { "index": 6, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The subject of the event in the context of the event source.", "constantName": "org.apache.camel.component.knative.KnativeConstants#CLOUD_EVENT_SUBJECT" }, "CamelCloudEventTime": { "index": 7, "kind": "header", "displayName": "", "group": "common", "label": "common", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The time the event occurred. The producer uses the exchange creation time when not set.", "constantName": "org.apache.camel.component.knative.KnativeConstants#CLOUD_EVENT_TIME" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "bytes", "null", "map", "list", "text", "value" ], "description": "The data of the event as a byte array, empty or null for an event without data. A structured event (Content-Type application\/cloudevents+json) gives its data field parsed from JSON: a Map, a List, text or a value" }, + "consumerReply": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "byOption": [ { "option": "reply", "value": "false", "carriers": [ "any" ] } ], "description": "The data of the reply, sent as bytes: text, bytes, a stream or a file; no body answers 204 No Content. A Map or a POJO fails: marshal it first. With reply=false the body is not sent" }, + "producerIn": { "carriers": [ "text", "bytes", "stream", "file" ], "description": "The data of the event: text, bytes, a stream or a file, sent as bytes. No body fails, and so does a Map or a POJO: marshal it first" }, + "producerOut": { "carriers": [ "bytes", "null" ], "description": "The body of the response, also for a message that expects no reply (InOnly): a byte array, null for a response without a body" } + }, "properties": { "type": { "index": 0, "kind": "path", "displayName": "Type", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "org.apache.camel.component.knative.spi.Knative.Type", "enum": [ "endpoint", "channel", "event" ], "deprecated": false, "autowired": false, "secret": false, "description": "The Knative resource type" }, "typeId": { "index": 1, "kind": "path", "displayName": "Type Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The identifier of the Knative resource" }, diff --git a/components/camel-knative/camel-knative-component/src/main/java/org/apache/camel/component/knative/KnativeEndpoint.java b/components/camel-knative/camel-knative-component/src/main/java/org/apache/camel/component/knative/KnativeEndpoint.java index 5c2530dd8e4a0..d631540590a43 100644 --- a/components/camel-knative/camel-knative-component/src/main/java/org/apache/camel/component/knative/KnativeEndpoint.java +++ b/components/camel-knative/camel-knative-component/src/main/java/org/apache/camel/component/knative/KnativeEndpoint.java @@ -36,6 +36,9 @@ import org.apache.camel.component.knative.spi.Knative; import org.apache.camel.component.knative.spi.KnativeResource; import org.apache.camel.component.knative.spi.KnativeTransportConfiguration; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -59,6 +62,23 @@ @Metadata(annotations = { "protocol=http", }) +@BodyTypes(consumerOut = @BodyType(value = { + Carrier.BYTES, Carrier.NULL, Carrier.MAP, Carrier.LIST, Carrier.TEXT, + Carrier.VALUE }, + description = "The data of the event as a byte array, empty or null for an event without" + + " data. A structured event (Content-Type application/cloudevents+json) gives" + + " its data field parsed from JSON: a Map, a List, text or a value"), + consumerReply = @BodyType(value = { Carrier.NULL, Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE }, + byOption = @BodyType.When(option = "reply", value = "false", carriers = Carrier.ANY), + description = "The data of the reply, sent as bytes: text, bytes, a stream or a file; no" + + " body answers 204 No Content. A Map or a POJO fails: marshal it first." + + " With reply=false the body is not sent"), + producerIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE }, + description = "The data of the event: text, bytes, a stream or a file, sent as bytes. No body" + + " fails, and so does a Map or a POJO: marshal it first"), + producerOut = @BodyType(value = { Carrier.BYTES, Carrier.NULL }, + description = "The body of the response, also for a message that expects no reply (InOnly):" + + " a byte array, null for a response without a body")) public class KnativeEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(KnativeEndpoint.class); diff --git a/components/camel-language/src/generated/resources/META-INF/org/apache/camel/component/language/language.json b/components/camel-language/src/generated/resources/META-INF/org/apache/camel/component/language/language.json index fb260589ad386..dcf729ff34def 100644 --- a/components/camel-language/src/generated/resources/META-INF/org/apache/camel/component/language/language.json +++ b/components/camel-language/src/generated/resources/META-INF/org/apache/camel/component/language/language.json @@ -32,6 +32,10 @@ "headers": { "CamelLanguageScript": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or Expression", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The script to execute provided in the header. Takes precedence over script configured on the endpoint.", "constantName": "org.apache.camel.component.language.LanguageConstants#LANGUAGE_SCRIPT" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body as the language of the script reads it. The script is in the uri, the script option or a resource, or in the CamelLanguageScript header with allowTemplateFromHeader=true, and never in the body" }, + "producerOut": { "carriers": [ "unknown" ], "byOption": [ { "option": "transform", "value": "false", "carriers": [ "unchanged" ] }, { "option": "binary", "value": "true", "carriers": [ "stream" ] } ], "description": "The result of the script, as the language gives it. Unchanged with transform=false. With binary=true the content of the resource as a stream, which is not evaluated" } + }, "properties": { "languageName": { "index": 0, "kind": "path", "displayName": "Language Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "bean", "constant", "datasonnet", "exchangeProperty", "file", "groovy", "header", "hl7terser", "java", "joor", "jq", "js", "jsonpath", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "xpath", "xquery", "xtokenize" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Sets the name of the language to use" }, "resourceUri": { "index": 1, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "Path to the resource, or a reference to lookup a bean in the Registry to use as the resource" }, diff --git a/components/camel-language/src/main/docs/language-component.adoc b/components/camel-language/src/main/docs/language-component.adoc index 435519cea521f..e7753b75dc569 100644 --- a/components/camel-language/src/main/docs/language-component.adoc +++ b/components/camel-language/src/main/docs/language-component.adoc @@ -131,7 +131,7 @@ Java:: [source,java] ---- from("direct:double") - .to("language:groovy:${body} * 2}"); + .to("language:groovy:body * 2"); ---- XML:: @@ -140,7 +140,7 @@ XML:: ---- - + ---- @@ -153,25 +153,26 @@ YAML:: uri: direct:double steps: - to: - uri: "language:groovy:${body} * 2}" + uri: "language:groovy:body * 2" ---- ==== -You can also provide the script as a header as shown below. Here we use +You can also provide the script as a header as shown below, when the endpoint +has `allowTemplateFromHeader=true`. Here we use xref:languages:xpath-language.adoc[XPath] language to extract the text from the `` tag. ._Java-only: providing the script as a message header_ [source,java] ---- -Object out = producer.requestBodyAndHeader("language:xpath", "Hello World", Exchange.LANGUAGE_SCRIPT, "/foo/text()"); +Object out = producer.requestBodyAndHeader("language:xpath?allowTemplateFromHeader=true", "Hello World", Exchange.LANGUAGE_SCRIPT, "/foo/text()"); assertEquals("Hello World", out); ---- == Loading scripts from resources You can specify a resource uri for a script to load in either the -endpoint uri, or in the `Exchange.LANGUAGE_SCRIPT` header. +endpoint uri, or in the `Exchange.LANGUAGE_SCRIPT` header (with `allowTemplateFromHeader=true`). The uri must start with one of the following schemes: `file:`, `classpath:`, or `http:` [tabs] diff --git a/components/camel-language/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java b/components/camel-language/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java index 3540253abc3ed..2d736c0be1b0d 100644 --- a/components/camel-language/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java +++ b/components/camel-language/src/main/java/org/apache/camel/component/language/LanguageEndpoint.java @@ -29,6 +29,9 @@ import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.ResourceEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Language; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -49,6 +52,17 @@ @UriEndpoint(firstVersion = "2.5.0", scheme = "language", title = "Language", syntax = "language:languageName:resourceUri", remote = false, producerOnly = true, category = { Category.CORE, Category.SCRIPT }, headersClass = LanguageConstants.class) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The body as the language of the script reads it. The script is in the uri," + + " the script option or a resource, or in the CamelLanguageScript header with" + + " allowTemplateFromHeader=true, and never in the body"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + byOption = { + @BodyType.When(option = "transform", value = "false", carriers = Carrier.UNCHANGED), + @BodyType.When(option = "binary", value = "true", carriers = Carrier.STREAM) }, + description = "The result of the script, as the language gives it. Unchanged with" + + " transform=false. With binary=true the content of the resource as a" + + " stream, which is not evaluated")) public class LanguageEndpoint extends ResourceEndpoint { private Language language; diff --git a/components/camel-once/src/generated/resources/META-INF/org/apache/camel/component/once/once.json b/components/camel-once/src/generated/resources/META-INF/org/apache/camel/component/once/once.json index 9d9a7c4b8c613..768303766ec43 100644 --- a/components/camel-once/src/generated/resources/META-INF/org/apache/camel/component/once/once.json +++ b/components/camel-once/src/generated/resources/META-INF/org/apache/camel/component/once/once.json @@ -29,6 +29,9 @@ "delay": { "index": 2, "kind": "property", "displayName": "Delay", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The number of milliseconds to wait before triggering. Use 0 or negative to fire as soon as possible. The default value is 1000." }, "languages": { "index": 3, "kind": "property", "displayName": "Languages", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether Camel languages are supported such as simple,groovy." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "null" ], "dependsOn": [ "body" ], "description": "No body without the body option. The body option gives its text, the text of a file:, classpath: or http: resource, a Boolean for true or false, a number for a whole number, or with language:NAME: the result of the expression" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The logical name" }, "body": { "index": 1, "kind": "parameter", "displayName": "Body", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "The data to use as message body. You can externalize the data by using file: or classpath: as prefix and specify the location of the file." }, diff --git a/components/camel-once/src/main/docs/once-component.adoc b/components/camel-once/src/main/docs/once-component.adoc index da5b467808ba0..0587dcfad165f 100644 --- a/components/camel-once/src/main/docs/once-component.adoc +++ b/components/camel-once/src/main/docs/once-component.adoc @@ -227,7 +227,7 @@ Java:: + [source,java] ---- -from("once:foo?body=file.data.json&delay=-1").to("bean:myBean?method=someMethodName"); +from("once:foo?body=file:data.json&delay=-1").to("bean:myBean?method=someMethodName"); ---- XML:: @@ -235,7 +235,7 @@ XML:: [source,xml] ---- - + ---- @@ -248,7 +248,7 @@ YAML:: from: uri: once:foo parameters: - body: file.data.json + body: file:data.json delay: -1 steps: - to: diff --git a/components/camel-once/src/main/java/org/apache/camel/component/once/OnceEndpoint.java b/components/camel-once/src/main/java/org/apache/camel/component/once/OnceEndpoint.java index bbe267cfc8c9c..80f93e91d9423 100644 --- a/components/camel-once/src/main/java/org/apache/camel/component/once/OnceEndpoint.java +++ b/components/camel-once/src/main/java/org/apache/camel/component/once/OnceEndpoint.java @@ -24,6 +24,9 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.RuntimeCamelException; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -35,6 +38,11 @@ */ @UriEndpoint(firstVersion = "4.17.0", scheme = "once", title = "Once", syntax = "once:name", consumerOnly = true, remote = false, category = { Category.CORE, Category.SCHEDULING }) +@BodyTypes(consumerOut = @BodyType(value = Carrier.NULL, dependsOn = "body", + description = "No body without the body option. The body option gives its text, the text of" + + " a file:, classpath: or http: resource, a Boolean for true or false, a" + + " number for a whole number, or with language:NAME: the result of the" + + " expression")) public class OnceEndpoint extends DefaultEndpoint { @UriPath diff --git a/components/camel-ref/src/generated/resources/META-INF/org/apache/camel/component/ref/ref.json b/components/camel-ref/src/generated/resources/META-INF/org/apache/camel/component/ref/ref.json index 2c8ab8073ccf7..93438a3abcf58 100644 --- a/components/camel-ref/src/generated/resources/META-INF/org/apache/camel/component/ref/ref.json +++ b/components/camel-ref/src/generated/resources/META-INF/org/apache/camel/component/ref/ref.json @@ -28,6 +28,11 @@ "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unknown" ], "description": "The body the consumer of the endpoint in the registry gives" }, + "producerIn": { "carriers": [ "any" ], "description": "The bodies the producer of the endpoint in the registry takes" }, + "producerOut": { "carriers": [ "unknown" ], "description": "The body the producer of the endpoint in the registry leaves" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of endpoint to lookup in the registry." }, "bridgeErrorHandler": { "index": 1, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, diff --git a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java index cee8b5b83f00f..d2f0410e051b5 100644 --- a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java +++ b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java @@ -23,6 +23,9 @@ import org.apache.camel.Endpoint; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriPath; @@ -34,6 +37,12 @@ */ @UriEndpoint(firstVersion = "1.2.0", scheme = "ref", title = "Ref", syntax = "ref:name", remote = false, category = { Category.CORE }) +@BodyTypes(consumerOut = @BodyType(value = Carrier.UNKNOWN, + description = "The body the consumer of the endpoint in the registry gives"), + producerIn = @BodyType(value = Carrier.ANY, + description = "The bodies the producer of the endpoint in the registry takes"), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "The body the producer of the endpoint in the registry leaves")) public class RefEndpoint extends DefaultEndpoint implements DelegateEndpoint { private volatile Endpoint endpoint; diff --git a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json index 0b170f11f2ec8..9eb5e7a75b7c9 100644 --- a/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json +++ b/components/camel-rest/src/generated/resources/META-INF/org/apache/camel/component/rest/rest-api.json @@ -28,6 +28,10 @@ "consumerComponentName": { "index": 1, "kind": "property", "displayName": "Consumer Component Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for the consumer REST transport, such as jetty, servlet, undertow. If no component has been explicitly configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or if a org.apache.camel.spi.RestApiConsumerFactory is registered in the registry. If either one is found, then that is being used." }, "autowiredEnabled": { "index": 2, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "null" ], "dependsOn": [ "consumerComponentName" ], "description": "The GET request for the API document, which has no body" }, + "consumerReply": { "carriers": [ "null", "text", "bytes", "stream" ], "dependsOn": [ "consumerComponentName" ], "description": "The API document the route of the REST DSL sets: the OpenAPI document as bytes, JSON unless the path ends with .yaml or the Accept header asks for YAML" } + }, "properties": { "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The base path" }, "apiComponentName": { "index": 1, "kind": "parameter", "displayName": "Api Component Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Camel Rest API component to use for generating the API of the REST services, such as openapi." }, diff --git a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java index 4eeef1a0d522c..e568916ea875e 100644 --- a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java +++ b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java @@ -26,6 +26,9 @@ import org.apache.camel.NoSuchBeanException; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.RestApiConsumerFactory; import org.apache.camel.spi.RestApiProcessorFactory; @@ -46,6 +49,13 @@ */ @UriEndpoint(firstVersion = "2.16.0", scheme = "rest-api", title = "REST API", syntax = "rest-api:path", remote = false, consumerOnly = true, category = { Category.CORE, Category.REST }, lenientProperties = true) +@BodyTypes(consumerOut = @BodyType(value = Carrier.NULL, dependsOn = "consumerComponentName", + description = "The GET request for the API document, which has no body"), + consumerReply = @BodyType(value = { Carrier.NULL, Carrier.TEXT, Carrier.BYTES, Carrier.STREAM }, + dependsOn = "consumerComponentName", + description = "The API document the route of the REST DSL sets: the OpenAPI document as" + + " bytes, JSON unless the path ends with .yaml or the Accept header asks" + + " for YAML")) public class RestApiEndpoint extends DefaultEndpoint { public static final String[] DEFAULT_REST_API_CONSUMER_COMPONENTS diff --git a/components/camel-saga/src/generated/resources/META-INF/org/apache/camel/component/saga/saga.json b/components/camel-saga/src/generated/resources/META-INF/org/apache/camel/component/saga/saga.json index 98e1f751e6e2b..3249b3bbba388 100644 --- a/components/camel-saga/src/generated/resources/META-INF/org/apache/camel/component/saga/saga.json +++ b/components/camel-saga/src/generated/resources/META-INF/org/apache/camel/component/saga/saga.json @@ -30,6 +30,10 @@ "headers": { "Long-Running-Action": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The long running action", "constantName": "org.apache.camel.component.saga.SagaConstants#SAGA_LONG_RUNNING_ACTION" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged: the saga service calls the completion or compensation endpoints with messages of its own" } + }, "properties": { "action": { "index": 0, "kind": "path", "displayName": "Action", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.saga.SagaEndpoint.SagaEndpointAction", "enum": [ "COMPLETE", "COMPENSATE" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Action to execute (complete or compensate)" }, "lazyStartProducer": { "index": 1, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." } diff --git a/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java b/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java index 089902732e1aa..e4fa071904ebd 100644 --- a/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java +++ b/components/camel-saga/src/main/java/org/apache/camel/component/saga/SagaEndpoint.java @@ -20,6 +20,9 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriPath; @@ -31,6 +34,10 @@ */ @UriEndpoint(firstVersion = "2.21.0", scheme = "saga", title = "Saga", syntax = "saga:action", producerOnly = true, category = { Category.CLUSTERING }, headersClass = SagaConstants.class) +@BodyTypes(producerIn = @BodyType(Carrier.ANY), + producerOut = @BodyType(value = Carrier.UNCHANGED, + description = "Unchanged: the saga service calls the completion or compensation endpoints" + + " with messages of its own")) public class SagaEndpoint extends DefaultEndpoint { public enum SagaEndpointAction { diff --git a/components/camel-stax/src/generated/resources/META-INF/org/apache/camel/language/xtokenizer/xtokenize.json b/components/camel-stax/src/generated/resources/META-INF/org/apache/camel/language/xtokenizer/xtokenize.json index d9a63ad907f51..b065c75e73731 100644 --- a/components/camel-stax/src/generated/resources/META-INF/org/apache/camel/language/xtokenizer/xtokenize.json +++ b/components/camel-stax/src/generated/resources/META-INF/org/apache/camel/language/xtokenizer/xtokenize.json @@ -15,6 +15,10 @@ "modelName": "xtokenize", "modelJavaType": "org.apache.camel.model.language.XMLTokenizerExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source" ], "description": "XML as text, bytes, a stream or a file, or a DOM" }, + "expressionOut": { "carriers": [ "iterator" ], "description": "An Iterator of the elements the path matches as XML text, read once; mode t gives their text. With group, each N elements are joined into one text" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java b/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java index b8322dbcaf593..c5c959746f718 100644 --- a/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java +++ b/components/camel-stax/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java @@ -22,6 +22,9 @@ import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Expression; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.ExpressionAdapter; import org.apache.camel.support.IteratorConvertTo; @@ -40,6 +43,12 @@ * */ @Language("xtokenize") +@BodyTypes(expressionIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.POJO }, + format = "xml", dependsOn = "source", + description = "XML as text, bytes, a stream or a file, or a DOM"), + expressionOut = @BodyType(value = Carrier.ITERATOR, + description = "An Iterator of the elements the path matches as XML text, read once; mode t" + + " gives their text. With group, each N elements are joined into one text")) public class XMLTokenizeLanguage extends SingleInputTypedLanguageSupport { @Override diff --git a/components/camel-stream/src/generated/resources/META-INF/org/apache/camel/component/stream/stream.json b/components/camel-stream/src/generated/resources/META-INF/org/apache/camel/component/stream/stream.json index 260f2172b9991..96e7923834b0f 100644 --- a/components/camel-stream/src/generated/resources/META-INF/org/apache/camel/component/stream/stream.json +++ b/components/camel-stream/src/generated/resources/META-INF/org/apache/camel/component/stream/stream.json @@ -32,6 +32,11 @@ "CamelStreamIndex": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The index", "constantName": "org.apache.camel.component.stream.StreamConstants#STREAM_INDEX" }, "CamelStreamComplete": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is complete", "constantName": "org.apache.camel.component.stream.StreamConstants#STREAM_COMPLETE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "dependsOn": [ "groupLines" ], "byOption": [ { "option": "readLine", "value": "false", "carriers": [ "bytes" ], "javaType": "byte[]" } ], "description": "Each line of the stream as text. With groupLines, a List of the lines; with readLine=false, all the bytes of the stream" }, + "producerIn": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "description": "Text in the encoding, or bytes, a stream or a file as bytes, followed by a new line; no body writes nothing. A Map or a POJO is written as its toString() and a List fails: marshal it first" }, + "producerOut": { "carriers": [ "unchanged" ] } + }, "properties": { "kind": { "index": 0, "kind": "path", "displayName": "Kind", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "in", "out", "err", "header", "file", "http" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Kind of stream to use such as System.in, System.out, a file, or a http url." }, "encoding": { "index": 1, "kind": "parameter", "displayName": "Encoding", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "You can configure the encoding (is a charset name) to use text-based streams (for example, message body is a String object). If not provided, Camel uses the JVM default Charset." }, diff --git a/components/camel-stream/src/main/docs/stream-component.adoc b/components/camel-stream/src/main/docs/stream-component.adoc index 706f831209ba6..829eff3eec51c 100644 --- a/components/camel-stream/src/main/docs/stream-component.adoc +++ b/components/camel-stream/src/main/docs/stream-component.adoc @@ -56,15 +56,14 @@ include::partial$component-endpoint-headers.adoc[] === Message content -The Stream component supports either `String` or `byte[]` for writing -to streams. Just add either `String` or `byte[]` content to the -`message.in.body`. Messages sent to the *stream:* producer in binary -mode are not followed by the newline character (as opposed to the -`String` messages). Message with `null` body will not be appended to the -output stream. + +The Stream component writes text, bytes, a stream or a file: text in the +`encoding`, and the others as bytes, each followed by a new line unless +`appendNewLine` is `false`. A message with a `null` body writes nothing. +Another body, such as a `Map`, is written as its `toString()`, so marshal it +first. + The special `stream:header` URI is used for custom output streams. Just add a `java.io.OutputStream` object to `message.in.header` in the key -`header`. + +`stream`. + See samples for an example. == Examples diff --git a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java index f7abcf630cfa1..487599c626727 100644 --- a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java +++ b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamEndpoint.java @@ -23,6 +23,9 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -36,6 +39,16 @@ */ @UriEndpoint(firstVersion = "1.3.0", scheme = "stream", title = "Stream", syntax = "stream:kind", category = { Category.FILE, Category.CORE }, headersClass = StreamConstants.class) +@BodyTypes(consumerOut = @BodyType(value = Carrier.TEXT, javaType = "java.lang.String", dependsOn = "groupLines", + byOption = @BodyType.When(option = "readLine", value = "false", carriers = Carrier.BYTES, + javaType = "byte[]"), + description = "Each line of the stream as text. With groupLines, a List of the lines; with" + + " readLine=false, all the bytes of the stream"), + producerIn = @BodyType(value = { Carrier.NULL, Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE }, + description = "Text in the encoding, or bytes, a stream or a file as bytes, followed by a new" + + " line; no body writes nothing. A Map or a POJO is written as its toString()" + + " and a List fails: marshal it first"), + producerOut = @BodyType(Carrier.UNCHANGED)) public class StreamEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(StreamEndpoint.class); diff --git a/components/camel-stub/src/generated/resources/META-INF/org/apache/camel/component/stub/stub.json b/components/camel-stub/src/generated/resources/META-INF/org/apache/camel/component/stub/stub.json index 889e38765279c..2aeb9bd3b00d7 100644 --- a/components/camel-stub/src/generated/resources/META-INF/org/apache/camel/component/stub/stub.json +++ b/components/camel-stub/src/generated/resources/META-INF/org/apache/camel/component/stub/stub.json @@ -38,6 +38,11 @@ "shadow": { "index": 10, "kind": "property", "displayName": "Shadow", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If shadow is enabled then the stub component will register a shadow endpoint with the actual uri that refers to the stub endpoint, meaning you can lookup the endpoint via both stub:kafka:cheese and kafka:cheese." }, "shadowPattern": { "index": 11, "kind": "property", "displayName": "Shadow Pattern", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "If shadow is enabled then this pattern can be used to filter which components to match. Multiple patterns can be separated by comma." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "unchanged" ], "description": "The body the producer sent" }, + "producerIn": { "carriers": [ "any" ] }, + "producerOut": { "carriers": [ "unknown" ], "description": "Unchanged when no route consumes from the stub endpoint, or for a message that expects no reply (InOnly). A message that expects one (InOut) waits for the body the stub route ends with" } + }, "properties": { "name": { "index": 0, "kind": "path", "displayName": "Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of queue" }, "size": { "index": 1, "kind": "parameter", "displayName": "Size", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). Will by default use the queueSize set on the SEDA component." }, diff --git a/components/camel-stub/src/main/java/org/apache/camel/component/stub/StubEndpoint.java b/components/camel-stub/src/main/java/org/apache/camel/component/stub/StubEndpoint.java index e745e04d14bac..ee4f40b7b9096 100644 --- a/components/camel-stub/src/main/java/org/apache/camel/component/stub/StubEndpoint.java +++ b/components/camel-stub/src/main/java/org/apache/camel/component/stub/StubEndpoint.java @@ -25,6 +25,9 @@ import org.apache.camel.Producer; import org.apache.camel.component.seda.BlockingQueueFactory; import org.apache.camel.component.seda.SedaEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; /** @@ -38,6 +41,12 @@ */ @UriEndpoint(firstVersion = "2.10.0", scheme = "stub", title = "Stub", syntax = "stub:name", remote = false, internal = true, category = { Category.CORE, Category.TESTING }, lenientProperties = true) +@BodyTypes(consumerOut = @BodyType(value = Carrier.UNCHANGED, description = "The body the producer sent"), + producerIn = @BodyType(Carrier.ANY), + producerOut = @BodyType(value = Carrier.UNKNOWN, + description = "Unchanged when no route consumes from the stub endpoint, or for a message" + + " that expects no reply (InOnly). A message that expects one (InOut) waits" + + " for the body the stub route ends with")) public class StubEndpoint extends SedaEndpoint { public StubEndpoint(String endpointUri, Component component, BlockingQueue queue) { diff --git a/components/camel-validator/src/generated/resources/META-INF/org/apache/camel/component/validator/validator.json b/components/camel-validator/src/generated/resources/META-INF/org/apache/camel/component/validator/validator.json index 8f36134aa8181..e6a59c38577e3 100644 --- a/components/camel-validator/src/generated/resources/META-INF/org/apache/camel/component/validator/validator.json +++ b/components/camel-validator/src/generated/resources/META-INF/org/apache/camel/component/validator/validator.json @@ -28,6 +28,10 @@ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "resourceResolverFactory": { "index": 2, "kind": "property", "displayName": "Resource Resolver Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.validator.ValidatorResourceResolverFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom LSResourceResolver which depends on a dynamic endpoint resource URI" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "headerName" ], "byOption": [ { "option": "failOnNullBody", "value": "false", "carriers": [ "null", "text", "bytes", "stream", "file", "pojo" ] } ], "description": "The XML to validate: text, bytes, a stream, a file, a DOM or another javax.xml.transform.Source. A Map, a List or no body fails; with headerName the header is validated instead" }, + "producerOut": { "carriers": [ "unchanged" ], "description": "Unchanged: XML that is not valid fails with a SchemaValidationException" } + }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "description": "URL to a local resource on the classpath, or a reference to lookup a bean in the Registry, or a full URL to a remote resource or resource on the file system which contains the XSD to validate against." }, "failOnNullBody": { "index": 1, "kind": "parameter", "displayName": "Fail On Null Body", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to fail if no body exists." }, diff --git a/components/camel-validator/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java b/components/camel-validator/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java index 0aa0d1053b495..6b7c85fbe345c 100644 --- a/components/camel-validator/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java +++ b/components/camel-validator/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java @@ -28,6 +28,9 @@ import org.apache.camel.Producer; import org.apache.camel.api.management.ManagedOperation; import org.apache.camel.api.management.ManagedResource; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -44,6 +47,17 @@ @ManagedResource(description = "Managed ValidatorEndpoint") @UriEndpoint(firstVersion = "1.1.0", scheme = "validator", title = "Validator", syntax = "validator:resourceUri", remote = false, producerOnly = true, category = { Category.CORE, Category.VALIDATION }) +@BodyTypes(producerIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.POJO }, + format = "xml", dependsOn = "headerName", + byOption = @BodyType.When(option = "failOnNullBody", value = "false", + carriers = { + Carrier.NULL, Carrier.TEXT, Carrier.BYTES, + Carrier.STREAM, Carrier.FILE, Carrier.POJO }), + description = "The XML to validate: text, bytes, a stream, a file, a DOM or another" + + " javax.xml.transform.Source. A Map, a List or no body fails; with headerName" + + " the header is validated instead"), + producerOut = @BodyType(value = Carrier.UNCHANGED, + description = "Unchanged: XML that is not valid fails with a SchemaValidationException")) public class ValidatorEndpoint extends DefaultEndpoint { @UriPath(description = "URL to a local resource on the classpath, or a reference to lookup a bean in the Registry," diff --git a/components/camel-wasm/src/generated/resources/META-INF/org/apache/camel/component/wasm/wasm.json b/components/camel-wasm/src/generated/resources/META-INF/org/apache/camel/component/wasm/wasm.json index 5bf98acf9c617..be436686faa88 100644 --- a/components/camel-wasm/src/generated/resources/META-INF/org/apache/camel/component/wasm/wasm.json +++ b/components/camel-wasm/src/generated/resources/META-INF/org/apache/camel/component/wasm/wasm.json @@ -31,6 +31,10 @@ "CamelWasmExitCode": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The exit code of the module: 0 when it returned from its _start function, otherwise the value it passed to proc_exit. Not set when the module trapped, timed out or exceeded maxOutputSize.", "constantName": "org.apache.camel.wasm.Wasm$Headers#EXIT_CODE" }, "CamelWasmStderr": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "What the module wrote to its standard error, decoded as UTF-8. Not set when the module wrote nothing or timed out.", "constantName": "org.apache.camel.wasm.Wasm$Headers#STDERR" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "null", "text", "bytes", "stream", "file" ], "description": "The standard input of the module: text, bytes, a stream or a file; no body is an empty input. A Map, a List or a POJO fails: marshal it first" }, + "producerOut": { "carriers": [ "bytes" ], "javaType": "byte[]", "description": "The standard output of the module, with the exit code in the CamelWasmExitCode header" } + }, "properties": { "module": { "index": 0, "kind": "path", "displayName": "Module", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The WASI Preview 1 command module to run, as a resource: by default from the classpath, or with a prefix such as classpath:, file: or http:" }, "args": { "index": 1, "kind": "parameter", "displayName": "Args", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.wasm.WasmConfiguration", "configurationField": "configuration", "description": "The command line arguments passed to the module, separated by whitespace. Use double quotes around an argument that contains whitespace. The module receives the file name of the module (for example upper.wasm, without scheme, directories or query) as argument zero, followed by these arguments. The arguments are fixed by the route: they cannot be set from message headers." }, diff --git a/components/camel-wasm/src/main/java/org/apache/camel/component/wasm/WasmEndpoint.java b/components/camel-wasm/src/main/java/org/apache/camel/component/wasm/WasmEndpoint.java index 5e0a663ee21d6..0f423412d0a9e 100644 --- a/components/camel-wasm/src/main/java/org/apache/camel/component/wasm/WasmEndpoint.java +++ b/components/camel-wasm/src/main/java/org/apache/camel/component/wasm/WasmEndpoint.java @@ -27,6 +27,9 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -44,6 +47,12 @@ @UriEndpoint(firstVersion = "4.4.0", scheme = Wasm.SCHEME, title = "Wasm", syntax = "wasm:module", producerOnly = true, remote = false, category = { Category.CORE, Category.SCRIPT }, headersClass = Wasm.Headers.class) +@BodyTypes(producerIn = @BodyType(value = { Carrier.NULL, Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE }, + description = "The standard input of the module: text, bytes, a stream or a file; no body is" + + " an empty input. A Map, a List or a POJO fails: marshal it first"), + producerOut = @BodyType(value = Carrier.BYTES, javaType = "byte[]", + description = "The standard output of the module, with the exit code in the" + + " CamelWasmExitCode header")) public class WasmEndpoint extends DefaultEndpoint { private static final String DEFAULT_PROGRAM_NAME = "module.wasm"; diff --git a/components/camel-xpath/src/generated/resources/META-INF/org/apache/camel/language/xpath/xpath.json b/components/camel-xpath/src/generated/resources/META-INF/org/apache/camel/language/xpath/xpath.json index e7e50b9357a1e..052b58d798f56 100644 --- a/components/camel-xpath/src/generated/resources/META-INF/org/apache/camel/language/xpath/xpath.json +++ b/components/camel-xpath/src/generated/resources/META-INF/org/apache/camel/language/xpath/xpath.json @@ -16,7 +16,7 @@ "modelJavaType": "org.apache.camel.model.language.XPathExpression" }, "bodyTypes": { - "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "description": "XML as text, bytes, a stream or a file, or a DOM" }, + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source" ], "description": "XML as text, bytes, a stream or a file, or a DOM" }, "expressionOut": { "carriers": [ "pojo" ], "javaType": "org.w3c.dom.NodeList", "dependsOn": [ "resultType" ], "byOption": [ { "option": "resultQName", "value": "STRING", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "resultQName", "value": "NUMBER", "carriers": [ "value" ], "javaType": "java.lang.Double" }, { "option": "resultQName", "value": "BOOLEAN", "carriers": [ "value" ], "javaType": "java.lang.Boolean" }, { "option": "resultQName", "value": "NODE", "carriers": [ "pojo" ], "javaType": "org.w3c.dom.Node" } ], "description": "The nodes the expression selects" } }, "properties": { diff --git a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java index 1e846164b355b..67f5f2f174e03 100644 --- a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java +++ b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathLanguage.java @@ -38,7 +38,8 @@ */ @Language("xpath") @BodyTypes(expressionIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.POJO }, - format = "xml", description = "XML as text, bytes, a stream or a file, or a DOM"), + format = "xml", dependsOn = "source", + description = "XML as text, bytes, a stream or a file, or a DOM"), expressionOut = @BodyType(value = Carrier.POJO, javaType = "org.w3c.dom.NodeList", dependsOn = "resultType", byOption = { @BodyType.When(option = "resultQName", value = "STRING", carriers = Carrier.TEXT, diff --git a/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json b/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json index 24a36d9612bf2..28cd2c8d05999 100644 --- a/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json +++ b/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json @@ -43,6 +43,10 @@ "CamelXsltStylesheet": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The template to use instead of the endpoint configured.", "constantName": "org.apache.camel.component.xslt.XsltConstants#XSLT_STYLESHEET" }, "CamelXsltFileName": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The XSLT file name", "constantName": "org.apache.camel.component.xslt.XsltConstants#XSLT_FILE_NAME" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo" ], "format": "xml", "dependsOn": [ "source", "useJsonBody" ], "byOption": [ { "option": "failOnNullBody", "value": "false", "carriers": [ "null", "text", "bytes", "stream", "file", "pojo" ] } ], "description": "The XML to transform: text, bytes, a stream, a file, a DOM or another javax.xml.transform.Source; JSON text with useJsonBody. A Map, a List or no body fails" }, + "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "dependsOn": [ "resultHandlerFactory" ], "byOption": [ { "option": "output", "value": "bytes", "carriers": [ "bytes" ], "javaType": "byte[]" }, { "option": "output", "value": "DOM", "carriers": [ "pojo" ], "javaType": "org.w3c.dom.Document" }, { "option": "output", "value": "file", "carriers": [ "file" ], "javaType": "java.io.File" } ], "description": "The result of the transformation" } + }, "properties": { "resourceUri": { "index": 0, "kind": "path", "displayName": "Resource Uri", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Path to the template. The following is supported by the default URIResolver. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod" }, "allowStAX": { "index": 1, "kind": "parameter", "displayName": "Allow StAX", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource." }, diff --git a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java index 062e463f2f8d7..3c5f8ce5e4f19 100644 --- a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java +++ b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java @@ -49,6 +49,9 @@ import org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy; import org.apache.camel.component.xslt.XsltBuilder; import org.apache.camel.component.xslt.XsltEndpoint; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.ClassResolver; import org.apache.camel.spi.Injector; import org.apache.camel.spi.Metadata; @@ -65,6 +68,24 @@ @ManagedResource(description = "Managed XsltSaxonEndpoint") @UriEndpoint(firstVersion = "3.0.0", scheme = "xslt-saxon", title = "XSLT Saxon", syntax = "xslt-saxon:resourceUri", remote = false, producerOnly = true, category = { Category.CORE, Category.TRANSFORMATION }) +@BodyTypes(producerIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.POJO }, + format = "xml", dependsOn = { "source", "useJsonBody" }, + byOption = @BodyType.When(option = "failOnNullBody", value = "false", + carriers = { + Carrier.NULL, Carrier.TEXT, Carrier.BYTES, + Carrier.STREAM, Carrier.FILE, Carrier.POJO }), + description = "The XML to transform: text, bytes, a stream, a file, a DOM or another" + + " javax.xml.transform.Source; JSON text with useJsonBody. A Map, a List or no" + + " body fails"), + producerOut = @BodyType(value = Carrier.TEXT, javaType = "java.lang.String", dependsOn = "resultHandlerFactory", + byOption = { + @BodyType.When(option = "output", value = "bytes", carriers = Carrier.BYTES, + javaType = "byte[]"), + @BodyType.When(option = "output", value = "DOM", carriers = Carrier.POJO, + javaType = "org.w3c.dom.Document"), + @BodyType.When(option = "output", value = "file", carriers = Carrier.FILE, + javaType = "java.io.File") }, + description = "The result of the transformation")) public class XsltSaxonEndpoint extends XsltEndpoint { private static final Logger LOG = LoggerFactory.getLogger(XsltSaxonEndpoint.class); diff --git a/core/camel-api/src/generated/java/org/apache/camel/spi/BodyType.java b/core/camel-api/src/generated/java/org/apache/camel/spi/BodyType.java index 2d2cc3b927240..be2616566c95e 100644 --- a/core/camel-api/src/generated/java/org/apache/camel/spi/BodyType.java +++ b/core/camel-api/src/generated/java/org/apache/camel/spi/BodyType.java @@ -133,7 +133,7 @@ enum Carrier { ANY("any"), /** * The body depends on what the other system sends, or on a class the user configures: tooling must not guess - * it. + * it. For the body after a step only: the bodies a step needs are ANY then. */ UNKNOWN("unknown"); diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/header/header.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/header/header.json index d295131eba167..a1e7e1255788b 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/header/header.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/header/header.json @@ -15,6 +15,9 @@ "modelName": "header", "modelJavaType": "org.apache.camel.model.language.HeaderExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the header as it is, null when there is none. A missing header falls back to the exchange property of that name" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/property/exchangeProperty.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/property/exchangeProperty.json index 30237a2819e4b..2dc10609366d5 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/property/exchangeProperty.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/property/exchangeProperty.json @@ -15,6 +15,9 @@ "modelName": "exchangeProperty", "modelJavaType": "org.apache.camel.model.language.ExchangePropertyExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the exchange property as it is, null when there is none" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/ref/ref.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/ref/ref.json index dcd78c00bc00f..18e2d383e0732 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/ref/ref.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/ref/ref.json @@ -15,6 +15,10 @@ "modelName": "ref", "modelJavaType": "org.apache.camel.model.language.RefExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "As the expression or the predicate in the registry reads it" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "What the expression in the registry returns; a Boolean for a predicate" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/file.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/file.json index 1e33e6ba029e5..f74414f152834 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/file.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/simple/file.json @@ -15,6 +15,10 @@ "modelName": "simple", "modelJavaType": "org.apache.camel.model.language.SimpleExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "any" ], "description": "The body as it is, for ${body}: the file functions read the headers the file consumers set" }, + "expressionOut": { "carriers": [ "unknown" ], "description": "A text with functions gives text, such as a file name. A single function gives its value as it is: ${file:size}, ${file:length} and ${file:modified} a Long, ${file:absolute} a Boolean, the other file functions text, and null without the headers of a file" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/tokenizer/tokenize.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/tokenizer/tokenize.json index 401f57fd5eba4..16dbce3bee17e 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/tokenizer/tokenize.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/tokenizer/tokenize.json @@ -15,6 +15,10 @@ "modelName": "tokenize", "modelJavaType": "org.apache.camel.model.language.TokenizerExpression" }, + "bodyTypes": { + "expressionIn": { "carriers": [ "text", "bytes", "stream", "file" ], "dependsOn": [ "source" ], "description": "Text as text, bytes, a stream or a file. Another body is tokenized as its toString(), and fails with endToken or xml: marshal it first" }, + "expressionOut": { "carriers": [ "iterator" ], "description": "An Iterator of the tokens as text, read once: in setBody the body is the Iterator, for the Split EIP to walk. With group, each N tokens are joined into one text" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "token": { "index": 1, "kind": "attribute", "displayName": "Token", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The (start) token to use as tokenizer, for example you can use the new line token. You can use simple language as the token to support dynamic tokens." }, diff --git a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/variable/variable.json b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/variable/variable.json index 73b49502e5e8f..1700bbf3b51f6 100644 --- a/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/variable/variable.json +++ b/core/camel-core-languages/src/generated/resources/META-INF/org/apache/camel/language/variable/variable.json @@ -15,6 +15,9 @@ "modelName": "variable", "modelJavaType": "org.apache.camel.model.language.VariableExpression" }, + "bodyTypes": { + "expressionOut": { "carriers": [ "unknown" ], "description": "The value of the variable as it is, null when there is none. A global: or route: prefix reads a global or a route variable" } + }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node." }, "expression": { "index": 1, "kind": "value", "displayName": "Expression", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax." }, diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/header/HeaderLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/header/HeaderLanguage.java index 29d2a9207f255..8ade107cb64a4 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/header/HeaderLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/header/HeaderLanguage.java @@ -18,6 +18,9 @@ import org.apache.camel.Expression; import org.apache.camel.Predicate; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.ExpressionToPredicateAdapter; import org.apache.camel.support.LanguageSupport; @@ -27,6 +30,9 @@ * A language for header expressions. */ @Language("header") +@BodyTypes(expressionOut = @BodyType(value = Carrier.UNKNOWN, + description = "The value of the header as it is, null when there is none. A missing header" + + " falls back to the exchange property of that name")) public class HeaderLanguage extends LanguageSupport { public static Expression header(String headerName) { diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/property/ExchangePropertyLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/property/ExchangePropertyLanguage.java index d2bc194a6374b..93ca404a250c5 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/property/ExchangePropertyLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/property/ExchangePropertyLanguage.java @@ -19,6 +19,9 @@ import org.apache.camel.Expression; import org.apache.camel.IsSingleton; import org.apache.camel.Predicate; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Language; import org.apache.camel.support.ExpressionToPredicateAdapter; import org.apache.camel.support.builder.ExpressionBuilder; @@ -27,6 +30,8 @@ * A language for exchange property expressions. */ @org.apache.camel.spi.annotations.Language("exchangeProperty") +@BodyTypes(expressionOut = @BodyType(value = Carrier.UNKNOWN, + description = "The value of the exchange property as it is, null when there is none")) public class ExchangePropertyLanguage implements Language, IsSingleton { public static Expression exchangeProperty(String propertyName) { diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/ref/RefLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/ref/RefLanguage.java index da678eccd338e..0f13f18fc5c03 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/ref/RefLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/ref/RefLanguage.java @@ -20,6 +20,9 @@ import org.apache.camel.Exchange; import org.apache.camel.Expression; import org.apache.camel.Predicate; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Registry; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.ExpressionAdapter; @@ -32,6 +35,10 @@ * A language for referred expressions or predicates. */ @Language("ref") +@BodyTypes(expressionIn = @BodyType(value = Carrier.ANY, + description = "As the expression or the predicate in the registry reads it"), + expressionOut = @BodyType(value = Carrier.UNKNOWN, + description = "What the expression in the registry returns; a Boolean for a predicate")) public class RefLanguage extends TypedLanguageSupport { @Override diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/FileLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/FileLanguage.java index f579745e9895a..51c92bb2a8a5a 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/FileLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/FileLanguage.java @@ -16,12 +16,23 @@ */ package org.apache.camel.language.simple; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.annotations.Language; /** * The Camel file language. */ @Language(value = "file", functionsClass = FileConstants.class) +@BodyTypes(expressionIn = @BodyType(value = Carrier.ANY, + description = "The body as it is, for ${body}: the file functions read the headers the file" + + " consumers set"), + expressionOut = @BodyType(value = Carrier.UNKNOWN, + description = "A text with functions gives text, such as a file name. A single function" + + " gives its value as it is: ${file:size}, ${file:length} and" + + " ${file:modified} a Long, ${file:absolute} a Boolean, the other file" + + " functions text, and null without the headers of a file")) public class FileLanguage extends SimpleLanguage { public FileLanguage() { diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java index feb0da7aed7b1..de7daf07135bc 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java @@ -21,6 +21,9 @@ import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Expression; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.ExpressionAdapter; import org.apache.camel.support.IteratorConvertTo; @@ -40,6 +43,14 @@ * token and endToken. And the xml mode supports the inheritNamespaceTagName option. */ @Language("tokenize") +@BodyTypes(expressionIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE }, + dependsOn = "source", + description = "Text as text, bytes, a stream or a file. Another body is tokenized as its" + + " toString(), and fails with endToken or xml: marshal it first"), + expressionOut = @BodyType(value = Carrier.ITERATOR, + description = "An Iterator of the tokens as text, read once: in setBody the body is the" + + " Iterator, for the Split EIP to walk. With group, each N tokens are" + + " joined into one text")) public class TokenizeLanguage extends SingleInputTypedLanguageSupport { @Override diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/variable/VariableLanguage.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/variable/VariableLanguage.java index ba6a306d4e1bf..d1ef73b2cbaf0 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/variable/VariableLanguage.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/variable/VariableLanguage.java @@ -18,6 +18,9 @@ import org.apache.camel.Expression; import org.apache.camel.Predicate; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.ExpressionToPredicateAdapter; import org.apache.camel.support.LanguageSupport; @@ -27,6 +30,9 @@ * A language for variable expressions. */ @Language("variable") +@BodyTypes(expressionOut = @BodyType(value = Carrier.UNKNOWN, + description = "The value of the variable as it is, null when there is none. A global: or" + + " route: prefix reads a global or a route variable")) public class VariableLanguage extends LanguageSupport { public static Expression variable(String name) { diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/TextBodyFlowTest.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/TextBodyFlowTest.java index 27c6c2b9e64a4..333ecc82ed601 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/TextBodyFlowTest.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/TextBodyFlowTest.java @@ -1186,6 +1186,57 @@ public void testTheBodyOfCloudMessaging() { .anySatisfy(m -> assertThat(m).contains("to: google-pubsub needs the body as text or bytes")); } + @Test + public void testTheBodyOfCoreComponents() { + // the stream consumer gives each line as text, so a field read needs an unmarshal, and stream:out writes text, + // bytes, a stream or a file, so parsed data must be marshalled first; the knative consumer gives bytes, or the + // data of a structured event parsed, so it says nothing, and after a bean the body is what the method returns + String yaml = """ + - route: + id: lines + from: + uri: stream:file?fileName=orders.txt + steps: + - setHeader: + name: id + simple: ${body[id]} + - route: + id: print + from: + uri: timer:tick + steps: + - setBody: + constant: '{"id": 1}' + - unmarshal: + json: {} + - to: stream:out + - route: + id: events + from: + uri: knative:endpoint/orders + steps: + - setHeader: + name: id + simple: ${body[id]} + - route: + id: beans + from: + uri: timer:tick + steps: + - setBody: + constant: '{"id": 1}' + - unmarshal: + json: {} + - to: bean:orders?method=toText + - to: file:outbox + """; + assertThat(lines(yaml)).hasSize(2).anySatisfy(m -> assertThat(m) + .contains("route lines: simple reads a field of the body (${body[id]})") + .contains("the stream consumer gives it as text")) + .anySatisfy(m -> assertThat(m) + .contains("route print: to: stream needs the body as text, bytes, a stream or a file")); + } + @Test public void testOneReportForAStepThatFails() { // the first write fails at runtime, so the second does not run with this body diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/BodyTypesHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/BodyTypesHelper.java index 8ce467e34661f..fdde7315fe116 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/BodyTypesHelper.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/BodyTypesHelper.java @@ -155,8 +155,9 @@ private static void checkValue(Class owner, String side, BodyType.When when, /** * A body has a carrier: an option value without one would say nothing. UNCHANGED is for the body after a step, such - * as a sql query that leaves it unchanged unless it is a select. ANY is for the bodies a step needs. ANY and - * UNKNOWN stand alone. + * as a sql query that leaves it unchanged unless it is a select. ANY is for the bodies a step needs, and UNKNOWN + * for the body after a step, so the bodies a step needs have one word for "whatever the body is". ANY and UNKNOWN + * stand alone. */ private static void check(Class owner, String side, Carrier[] carriers) { if (carriers.length == 0) { @@ -168,6 +169,10 @@ private static void check(Class owner, String side, Carrier[] carriers) { throw new IllegalArgumentException( owner.getName() + ": the @BodyTypes " + side + " is what a step needs, which cannot be unchanged"); } + if (in && list.contains(Carrier.UNKNOWN)) { + throw new IllegalArgumentException( + owner.getName() + ": the @BodyTypes " + side + " is what a step needs, which is any, not unknown"); + } if (!in && list.contains(Carrier.ANY)) { throw new IllegalArgumentException( owner.getName() + ": the @BodyTypes " + side + " is the body after a step, which cannot be any"); diff --git a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojoTest.java b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojoTest.java index 24d5b3d86b84e..fc5e64ec4ade0 100644 --- a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojoTest.java +++ b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojoTest.java @@ -278,6 +278,7 @@ void testEndpointWithoutBodyTypes() throws Exception { @ValueSource(classes = { SomeEndpointWithBadBodyTypes.DataFormatSide.class, SomeEndpointWithBadBodyTypes.ProducerSideOfConsumer.class, SomeEndpointWithBadBodyTypes.UnchangedInput.class, SomeEndpointWithBadBodyTypes.AnyOutput.class, + SomeEndpointWithBadBodyTypes.UnknownInput.class, SomeEndpointWithBadBodyTypes.UnknownWithOthers.class, SomeEndpointWithBadBodyTypes.NoCarriers.class, SomeEndpointWithBadBodyTypes.UnknownOption.class, SomeEndpointWithBadBodyTypes.OptionValueWithoutCarriers.class, SomeEndpointWithBadBodyTypes.ValueTheOptionDoesNotHave.class }) diff --git a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/endpoint/SomeEndpointWithBadBodyTypes.java b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/endpoint/SomeEndpointWithBadBodyTypes.java index 8c0f53728d6a6..9e3fc43a5f623 100644 --- a/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/endpoint/SomeEndpointWithBadBodyTypes.java +++ b/tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/endpoint/SomeEndpointWithBadBodyTypes.java @@ -49,6 +49,11 @@ public static class UnchangedInput { public static class AnyOutput { } + @UriEndpoint(scheme = "some", syntax = "some", title = "some") + @BodyTypes(producerIn = @BodyType(Carrier.UNKNOWN)) + public static class UnknownInput { + } + @UriEndpoint(scheme = "some", syntax = "some", title = "some") @BodyTypes(producerOut = @BodyType({ Carrier.UNKNOWN, Carrier.TEXT })) public static class UnknownWithOthers { diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/BodyType.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/BodyType.java index 2d2cc3b927240..be2616566c95e 100644 --- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/BodyType.java +++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/BodyType.java @@ -133,7 +133,7 @@ enum Carrier { ANY("any"), /** * The body depends on what the other system sends, or on a class the user configures: tooling must not guess - * it. + * it. For the body after a step only: the bodies a step needs are ANY then. */ UNKNOWN("unknown");