This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new e33ef04 CAMEL-16724: camel-mock - Add option to log when a message is
received
e33ef04 is described below
commit e33ef04f14932d58b1e84bcf9961964430325104
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Jun 17 15:35:06 2021 +0200
CAMEL-16724: camel-mock - Add option to log when a message is received
---
.../camel/catalog/components/dataset-test.json | 5 ++-
.../apache/camel/catalog/components/dataset.json | 5 ++-
.../org/apache/camel/catalog/components/mock.json | 5 ++-
.../camel/catalog/docs/dataset-component.adoc | 7 ++-
.../camel/catalog/docs/dataset-test-component.adoc | 7 ++-
.../apache/camel/catalog/docs/mock-component.adoc | 7 ++-
.../dataset/DataSetComponentConfigurer.java | 22 +++-------
.../dataset/DataSetEndpointUriFactory.java | 3 +-
.../dataset/DataSetTestComponentConfigurer.java | 38 +---------------
.../dataset/DataSetTestEndpointUriFactory.java | 3 +-
.../camel/component/dataset/dataset-test.json | 5 ++-
.../apache/camel/component/dataset/dataset.json | 5 ++-
.../src/main/docs/dataset-component.adoc | 7 ++-
.../src/main/docs/dataset-test-component.adoc | 7 ++-
.../camel/component/dataset/DataSetComponent.java | 11 +++--
.../component/dataset/DataSetTestComponent.java | 5 ++-
.../component/dataset/DataSetTestEndpoint.java | 3 +-
.../component/mock/MockComponentConfigurer.java | 14 ++++++
.../component/mock/MockEndpointConfigurer.java | 3 ++
.../component/mock/MockEndpointUriFactory.java | 13 +++---
.../org/apache/camel/component/mock/mock.json | 5 ++-
.../camel-mock/src/main/docs/mock-component.adoc | 7 ++-
.../apache/camel/component/mock/MockComponent.java | 51 ++++++++++++++++++++++
.../apache/camel/component/mock/MockEndpoint.java | 26 +++++++++++
.../dsl/DatasetComponentBuilderFactory.java | 38 ++++++++++++++++
.../dsl/DatasetTestComponentBuilderFactory.java | 38 ++++++++++++++++
.../component/dsl/MockComponentBuilderFactory.java | 38 ++++++++++++++++
.../camel/component/mock/MockComponentLogTest.java | 47 ++++++++++++++++++++
.../apache/camel/component/mock/MockLogTest.java | 46 +++++++++++++++++++
.../dsl/DataSetEndpointBuilderFactory.java | 37 ++++++++++++++++
.../dsl/DataSetTestEndpointBuilderFactory.java | 37 ++++++++++++++++
.../endpoint/dsl/MockEndpointBuilderFactory.java | 37 ++++++++++++++++
.../JmxInstrumentationCustomMBeanTest.java | 4 +-
.../modules/ROOT/pages/dataset-component.adoc | 7 ++-
.../modules/ROOT/pages/dataset-test-component.adoc | 7 ++-
.../modules/ROOT/pages/mock-component.adoc | 7 ++-
36 files changed, 514 insertions(+), 93 deletions(-)
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 d88d7ab..3b624ff 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
@@ -23,7 +23,9 @@
},
"componentProperties": {
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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" },
@@ -33,6 +35,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
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 d926076..cedea55 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
@@ -24,7 +24,9 @@
"componentProperties": {
"bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error
Handler", "group": "consumer", "label": "consumer", "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a me [...]
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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" },
@@ -41,6 +43,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mock.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mock.json
index 636b078..9304b99 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mock.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mock.json
@@ -23,7 +23,9 @@
},
"componentProperties": {
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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 mock endpoint" },
@@ -31,6 +33,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
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 5fe2f722..fdb35cf 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
@@ -55,7 +55,7 @@ extend `DataSetSupport`.
// component options: START
-The Dataset component supports 3 options, which are listed below.
+The Dataset component supports 5 options, which are listed below.
@@ -64,7 +64,9 @@ The Dataset component supports 3 options, which are listed
below.
| Name | Description | Default | Type
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -89,7 +91,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (20 parameters):
+=== Query Parameters (21 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -108,6 +110,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-test-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-test-component.adoc
index 4e5e7fb..29514cb 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-test-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/dataset-test-component.adoc
@@ -51,7 +51,7 @@ pulled from before starting the test.
== URI Options
// component options: START
-The DataSet Test component supports 2 options, which are listed below.
+The DataSet Test component supports 4 options, which are listed below.
@@ -59,7 +59,9 @@ The DataSet Test component supports 2 options, which are
listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -83,7 +85,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (15 parameters):
+=== Query Parameters (16 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -95,6 +97,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mock-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mock-component.adoc
index 159f927..1fc3947 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mock-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mock-component.adoc
@@ -89,7 +89,7 @@ You can append query options to the URI in the following
format,
// component options: START
-The Mock component supports 2 options, which are listed below.
+The Mock component supports 4 options, which are listed below.
@@ -97,7 +97,9 @@ The Mock component supports 2 options, which are listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -125,7 +127,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -135,6 +137,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetComponentConfigurer.java
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetComponentConfigurer.java
index 0c42b3a..91b73ae 100644
---
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetComponentConfigurer.java
+++
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetComponentConfigurer.java
@@ -9,38 +9,30 @@ import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
+import org.apache.camel.component.mock.MockComponentConfigurer;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class DataSetComponentConfigurer extends PropertyConfigurerSupport
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class DataSetComponentConfigurer extends MockComponentConfigurer
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String
name, Object value, boolean ignoreCase) {
DataSetComponent target = (DataSetComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled":
target.setAutowiredEnabled(property(camelContext, boolean.class, value));
return true;
case "bridgeerrorhandler":
case "bridgeErrorHandler":
target.setBridgeErrorHandler(property(camelContext, boolean.class, value));
return true;
- case "lazystartproducer":
- case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
- default: return false;
+ default: return super.configure(camelContext, obj, name, value,
ignoreCase);
}
}
@Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return boolean.class;
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- default: return null;
+ default: return super.getOptionType(name, ignoreCase);
}
}
@@ -48,13 +40,9 @@ public class DataSetComponentConfigurer extends
PropertyConfigurerSupport implem
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
DataSetComponent target = (DataSetComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return target.isAutowiredEnabled();
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- default: return null;
+ default: return super.getOptionValue(obj, name, ignoreCase);
}
}
}
diff --git
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetEndpointUriFactory.java
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetEndpointUriFactory.java
index e7c7f47..ce08af8 100644
---
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetEndpointUriFactory.java
+++
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetEndpointUriFactory.java
@@ -20,7 +20,8 @@ public class DataSetEndpointUriFactory extends
org.apache.camel.support.componen
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(21);
+ Set<String> props = new HashSet<>(22);
+ props.add("log");
props.add("consumeDelay");
props.add("exchangePattern");
props.add("preloadSize");
diff --git
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestComponentConfigurer.java
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestComponentConfigurer.java
index 8d04da7..ee1c4e1 100644
---
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestComponentConfigurer.java
+++
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestComponentConfigurer.java
@@ -9,47 +9,13 @@ import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
+import org.apache.camel.component.mock.MockComponentConfigurer;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class DataSetTestComponentConfigurer extends PropertyConfigurerSupport
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class DataSetTestComponentConfigurer extends MockComponentConfigurer
implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String
name, Object value, boolean ignoreCase) {
- DataSetTestComponent target = (DataSetTestComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled":
target.setAutowiredEnabled(property(camelContext, boolean.class, value));
return true;
- case "lazystartproducer":
- case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return boolean.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- DataSetTestComponent target = (DataSetTestComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return target.isAutowiredEnabled();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- default: return null;
- }
- }
}
diff --git
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestEndpointUriFactory.java
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestEndpointUriFactory.java
index cf538d4..aaa0e79 100644
---
a/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestEndpointUriFactory.java
+++
b/components/camel-dataset/src/generated/java/org/apache/camel/component/dataset/DataSetTestEndpointUriFactory.java
@@ -20,7 +20,8 @@ public class DataSetTestEndpointUriFactory extends
org.apache.camel.support.comp
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(16);
+ Set<String> props = new HashSet<>(17);
+ props.add("log");
props.add("anyOrder");
props.add("expectedCount");
props.add("retainLast");
diff --git
a/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset-test.json
b/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset-test.json
index d88d7ab..3b624ff 100644
---
a/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset-test.json
+++
b/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset-test.json
@@ -23,7 +23,9 @@
},
"componentProperties": {
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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" },
@@ -33,6 +35,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
diff --git
a/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset.json
b/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset.json
index d926076..cedea55 100644
---
a/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset.json
+++
b/components/camel-dataset/src/generated/resources/org/apache/camel/component/dataset/dataset.json
@@ -24,7 +24,9 @@
"componentProperties": {
"bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error
Handler", "group": "consumer", "label": "consumer", "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 occurred
while the consumer is trying to pickup incoming messages, or the likes, will
now be processed as a me [...]
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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" },
@@ -41,6 +43,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
diff --git a/components/camel-dataset/src/main/docs/dataset-component.adoc
b/components/camel-dataset/src/main/docs/dataset-component.adoc
index 5fe2f722..fdb35cf 100644
--- a/components/camel-dataset/src/main/docs/dataset-component.adoc
+++ b/components/camel-dataset/src/main/docs/dataset-component.adoc
@@ -55,7 +55,7 @@ extend `DataSetSupport`.
// component options: START
-The Dataset component supports 3 options, which are listed below.
+The Dataset component supports 5 options, which are listed below.
@@ -64,7 +64,9 @@ The Dataset component supports 3 options, which are listed
below.
| Name | Description | Default | Type
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -89,7 +91,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (20 parameters):
+=== Query Parameters (21 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -108,6 +110,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git a/components/camel-dataset/src/main/docs/dataset-test-component.adoc
b/components/camel-dataset/src/main/docs/dataset-test-component.adoc
index 4e5e7fb..29514cb 100644
--- a/components/camel-dataset/src/main/docs/dataset-test-component.adoc
+++ b/components/camel-dataset/src/main/docs/dataset-test-component.adoc
@@ -51,7 +51,7 @@ pulled from before starting the test.
== URI Options
// component options: START
-The DataSet Test component supports 2 options, which are listed below.
+The DataSet Test component supports 4 options, which are listed below.
@@ -59,7 +59,9 @@ The DataSet Test component supports 2 options, which are
listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -83,7 +85,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (15 parameters):
+=== Query Parameters (16 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -95,6 +97,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git
a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetComponent.java
b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetComponent.java
index 357a626..0914ff8 100644
---
a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetComponent.java
+++
b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetComponent.java
@@ -19,14 +19,14 @@ package org.apache.camel.component.dataset;
import java.util.Map;
import org.apache.camel.Endpoint;
+import org.apache.camel.component.mock.MockComponent;
import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.DefaultComponent;
/**
* Component for <a href="http://camel.apache.org/dataset.html">DataSet</a>.
*/
@org.apache.camel.spi.annotations.Component("dataset")
-public class DataSetComponent extends DefaultComponent {
+public class DataSetComponent extends MockComponent {
public DataSetComponent() {
}
@@ -34,6 +34,11 @@ public class DataSetComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
DataSet dataSet =
CamelContextHelper.mandatoryLookup(getCamelContext(), remaining, DataSet.class);
- return new DataSetEndpoint(uri, this, dataSet);
+
+ DataSetEndpoint endpoint = new DataSetEndpoint(uri, this, dataSet);
+ endpoint.setLog(isLog());
+ setProperties(endpoint, parameters);
+
+ return endpoint;
}
}
diff --git
a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
index dc71075..4406448 100644
---
a/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
+++
b/components/camel-dataset/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
@@ -19,8 +19,8 @@ package org.apache.camel.component.dataset;
import java.util.Map;
import org.apache.camel.Endpoint;
+import org.apache.camel.component.mock.MockComponent;
import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.DefaultComponent;
import org.apache.camel.util.URISupport;
/**
@@ -31,7 +31,7 @@ import org.apache.camel.util.URISupport;
* receive during testing.
*/
@org.apache.camel.spi.annotations.Component("dataset-test")
-public class DataSetTestComponent extends DefaultComponent {
+public class DataSetTestComponent extends MockComponent {
public DataSetTestComponent() {
}
@@ -43,6 +43,7 @@ public class DataSetTestComponent extends DefaultComponent {
if (timeout != null) {
answer.setTimeout(timeout);
}
+ answer.setLog(isLog());
setProperties(answer, parameters);
// from the rest create a new uri with those parameters
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 0b65e07..575cd68 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
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.apache.camel.Category;
import org.apache.camel.Component;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
@@ -44,7 +45,7 @@ import org.slf4j.LoggerFactory;
* match the number of expected messages and their message payloads are equal.
*/
@UriEndpoint(firstVersion = "1.3.0", scheme = "dataset-test", title = "DataSet
Test", syntax = "dataset-test:name",
- producerOnly = true, label = "core,testing", lenientProperties =
true)
+ producerOnly = true, category = { Category.CORE, Category.TESTING
}, lenientProperties = true)
public class DataSetTestEndpoint extends MockEndpoint {
private static final Logger LOG =
LoggerFactory.getLogger(DataSetTestEndpoint.class);
diff --git
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockComponentConfigurer.java
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockComponentConfigurer.java
index 0232a4e..0f573a2 100644
---
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockComponentConfigurer.java
+++
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockComponentConfigurer.java
@@ -23,19 +23,30 @@ public class MockComponentConfigurer extends
PropertyConfigurerSupport implement
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled":
target.setAutowiredEnabled(property(camelContext, boolean.class, value));
return true;
+ case "exchangeformatter":
+ case "exchangeFormatter":
target.setExchangeFormatter(property(camelContext,
org.apache.camel.spi.ExchangeFormatter.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
+ case "log": target.setLog(property(camelContext, boolean.class,
value)); return true;
default: return false;
}
}
@Override
+ public String[] getAutowiredNames() {
+ return new String[]{"exchangeFormatter"};
+ }
+
+ @Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return boolean.class;
+ case "exchangeformatter":
+ case "exchangeFormatter": return
org.apache.camel.spi.ExchangeFormatter.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
+ case "log": return boolean.class;
default: return null;
}
}
@@ -46,8 +57,11 @@ public class MockComponentConfigurer extends
PropertyConfigurerSupport implement
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "exchangeformatter":
+ case "exchangeFormatter": return target.getExchangeFormatter();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
+ case "log": return target.isLog();
default: return null;
}
}
diff --git
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointConfigurer.java
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointConfigurer.java
index db9641e..0934368 100644
---
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointConfigurer.java
+++
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointConfigurer.java
@@ -31,6 +31,7 @@ public class MockEndpointConfigurer extends
PropertyConfigurerSupport implements
case "failFast": target.setFailFast(property(camelContext,
boolean.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer":
target.setLazyStartProducer(property(camelContext, boolean.class, value));
return true;
+ case "log": target.setLog(property(camelContext, boolean.class,
value)); return true;
case "reportgroup":
case "reportGroup": target.setReportGroup(property(camelContext,
int.class, value)); return true;
case "resultminimumwaittime":
@@ -60,6 +61,7 @@ public class MockEndpointConfigurer extends
PropertyConfigurerSupport implements
case "failFast": return boolean.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
+ case "log": return boolean.class;
case "reportgroup":
case "reportGroup": return int.class;
case "resultminimumwaittime":
@@ -90,6 +92,7 @@ public class MockEndpointConfigurer extends
PropertyConfigurerSupport implements
case "failFast": return target.isFailFast();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
+ case "log": return target.isLog();
case "reportgroup":
case "reportGroup": return target.getReportGroup();
case "resultminimumwaittime":
diff --git
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointUriFactory.java
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointUriFactory.java
index 8e53c66..ae65b45 100644
---
a/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointUriFactory.java
+++
b/components/camel-mock/src/generated/java/org/apache/camel/component/mock/MockEndpointUriFactory.java
@@ -20,17 +20,18 @@ public class MockEndpointUriFactory extends
org.apache.camel.support.component.E
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(12);
- props.add("reportGroup");
- props.add("sleepForEmptyTest");
- props.add("lazyStartProducer");
- props.add("name");
+ Set<String> props = new HashSet<>(13);
+ props.add("log");
props.add("expectedCount");
props.add("retainLast");
- props.add("copyOnExchange");
props.add("assertPeriod");
props.add("failFast");
props.add("resultMinimumWaitTime");
+ props.add("reportGroup");
+ props.add("sleepForEmptyTest");
+ props.add("lazyStartProducer");
+ props.add("name");
+ props.add("copyOnExchange");
props.add("resultWaitTime");
props.add("retainFirst");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
diff --git
a/components/camel-mock/src/generated/resources/org/apache/camel/component/mock/mock.json
b/components/camel-mock/src/generated/resources/org/apache/camel/component/mock/mock.json
index 636b078..9304b99 100644
---
a/components/camel-mock/src/generated/resources/org/apache/camel/component/mock/mock.json
+++
b/components/camel-mock/src/generated/resources/org/apache/camel/component/mock/mock.json
@@ -23,7 +23,9 @@
},
"componentProperties": {
"lazyStartProducer": { "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 star [...]
- "autowiredEnabled": { "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 t [...]
+ "log": { "kind": "property", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.MockE [...]
+ "autowiredEnabled": { "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 t [...]
+ "exchangeFormatter": { "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": "Sets a
custom ExchangeFormatter to convert the Exchange to a String suitable for
logging. If not specified, we default to DefaultExchangeFormatter." }
},
"properties": {
"name": { "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 mock endpoint" },
@@ -31,6 +33,7 @@
"expectedCount": { "kind": "parameter", "displayName": "Expected Count",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": -1, "description": "Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a ass [...]
"failFast": { "kind": "parameter", "displayName": "Fail Fast", "group":
"producer", "label": "producer", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "description": "Sets whether assertIsSatisfied()
should fail fast at the first detected failed expectation while it may
otherwise wait for all expected messages to arrive before performing
expectations verifications. Is by default true. Set [...]
"lazyStartProducer": { "kind": "parameter", "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 sta [...]
+ "log": { "kind": "parameter", "displayName": "Log", "group": "producer",
"label": "producer", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "To turn on logging when the mock
receives an incoming message. This will log only one time at INFO level for the
incoming message. For more detailed logging then set the logger to DEBUG level
for the org.apache.camel.component.mock.Mock [...]
"reportGroup": { "kind": "parameter", "displayName": "Report Group",
"group": "producer", "label": "producer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"description": "A number that is used to turn on throughput logging based on
groups of the size." },
"resultMinimumWaitTime": { "kind": "parameter", "displayName": "Result
Minimum Wait Time", "group": "producer", "label": "producer", "required":
false, "type": "duration", "javaType": "long", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "0", "description": "Sets
the minimum expected amount of time (in millis) the assertIsSatisfied() will
wait on a latch until it is satisfied" },
"resultWaitTime": { "kind": "parameter", "displayName": "Result Wait
Time", "group": "producer", "label": "producer", "required": false, "type":
"duration", "javaType": "long", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": "0", "description": "Sets the maximum amount
of time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied" },
diff --git a/components/camel-mock/src/main/docs/mock-component.adoc
b/components/camel-mock/src/main/docs/mock-component.adoc
index 159f927..1fc3947 100644
--- a/components/camel-mock/src/main/docs/mock-component.adoc
+++ b/components/camel-mock/src/main/docs/mock-component.adoc
@@ -89,7 +89,7 @@ You can append query options to the URI in the following
format,
// component options: START
-The Mock component supports 2 options, which are listed below.
+The Mock component supports 4 options, which are listed below.
@@ -97,7 +97,9 @@ The Mock component supports 2 options, which are listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -125,7 +127,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -135,6 +137,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockComponent.java
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockComponent.java
index 8ba236e..429dd5a 100644
---
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockComponent.java
+++
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockComponent.java
@@ -22,7 +22,10 @@ import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.Processor;
import org.apache.camel.spi.CamelLogger;
+import org.apache.camel.spi.ExchangeFormatter;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.processor.DefaultExchangeFormatter;
import org.apache.camel.support.processor.ThroughputLogger;
/**
@@ -31,6 +34,11 @@ import org.apache.camel.support.processor.ThroughputLogger;
@org.apache.camel.spi.annotations.Component("mock")
public class MockComponent extends DefaultComponent {
+ @Metadata(label = "producer")
+ private boolean log;
+ @Metadata(label = "advanced", autowired = true)
+ private ExchangeFormatter exchangeFormatter;
+
public MockComponent() {
}
@@ -42,6 +50,7 @@ public class MockComponent extends DefaultComponent {
protected Endpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
MockEndpoint endpoint = new MockEndpoint(uri, this);
endpoint.setName(remaining);
+ endpoint.setLog(log);
Integer value = getAndRemoveParameter(parameters, "reportGroup",
Integer.class);
if (value != null) {
@@ -49,6 +58,48 @@ public class MockComponent extends DefaultComponent {
endpoint.setReporter(reporter);
endpoint.setReportGroup(value);
}
+ setProperties(endpoint, parameters);
return endpoint;
}
+
+ @Override
+ protected void doInit() throws Exception {
+ if (exchangeFormatter == null) {
+ DefaultExchangeFormatter def = new DefaultExchangeFormatter();
+ def.setShowExchangeId(true);
+ def.setShowExchangePattern(false);
+ def.setSkipBodyLineSeparator(true);
+ def.setShowBody(true);
+ def.setShowBodyType(true);
+ def.setStyle(DefaultExchangeFormatter.OutputStyle.Default);
+ def.setMaxChars(10000);
+ exchangeFormatter = def;
+ }
+ }
+
+ public boolean isLog() {
+ return log;
+ }
+
+ /**
+ * To turn on logging when the mock receives an incoming message.
+ * <p/>
+ * This will log only one time at INFO level for the incoming message. For
more detailed logging then set the logger
+ * to DEBUG level for the org.apache.camel.component.mock.MockEndpoint
class.
+ */
+ public void setLog(boolean log) {
+ this.log = log;
+ }
+
+ public ExchangeFormatter getExchangeFormatter() {
+ return exchangeFormatter;
+ }
+
+ /**
+ * Sets a custom {@link ExchangeFormatter} to convert the Exchange to a
String suitable for logging. If not
+ * specified, we default to {@link DefaultExchangeFormatter}.
+ */
+ public void setExchangeFormatter(ExchangeFormatter exchangeFormatter) {
+ this.exchangeFormatter = exchangeFormatter;
+ }
}
diff --git
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 1a47bbb..3d6c3bb 100644
---
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -139,6 +139,8 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
@UriParam(label = "producer")
private int reportGroup;
@UriParam(label = "producer")
+ private boolean log;
+ @UriParam(label = "producer")
private boolean failFast = true;
@UriParam(label = "producer,advanced", defaultValue = "true")
private boolean copyOnExchange = true;
@@ -1527,6 +1529,20 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
this.reportGroup = reportGroup;
}
+ public boolean isLog() {
+ return log;
+ }
+
+ /**
+ * To turn on logging when the mock receives an incoming message.
+ * <p/>
+ * This will log only one time at INFO level for the incoming message. For
more detailed logging then set the logger
+ * to DEBUG level for the org.apache.camel.component.mock.MockEndpoint
class.
+ */
+ public void setLog(boolean log) {
+ this.log = log;
+ }
+
public boolean isCopyOnExchange() {
return copyOnExchange;
}
@@ -1557,8 +1573,18 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
// Implementation methods
//
-------------------------------------------------------------------------
+ @Override
+ public MockComponent getComponent() {
+ return (MockComponent) super.getComponent();
+ }
+
protected synchronized void onExchange(Exchange exchange) {
try {
+ if (log) {
+ String line =
getComponent().getExchangeFormatter().format(exchange);
+ LOG.info("mock:{} received #{} -> {}", getName(), counter + 1,
line);
+ }
+
if (reporter != null) {
reporter.process(exchange);
}
diff --git
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetComponentBuilderFactory.java
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetComponentBuilderFactory.java
index 7a7dcd7..e989605 100644
---
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetComponentBuilderFactory.java
+++
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetComponentBuilderFactory.java
@@ -97,6 +97,24 @@ public interface DatasetComponentBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DatasetComponentBuilder log(boolean log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* 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,
@@ -117,6 +135,24 @@ public interface DatasetComponentBuilderFactory {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
+ /**
+ * Sets a custom ExchangeFormatter to convert the Exchange to a String
+ * suitable for logging. If not specified, we default to
+ * DefaultExchangeFormatter.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.ExchangeFormatter</code>
type.
+ *
+ * Group: advanced
+ *
+ * @param exchangeFormatter the value to set
+ * @return the dsl builder
+ */
+ default DatasetComponentBuilder exchangeFormatter(
+ org.apache.camel.spi.ExchangeFormatter exchangeFormatter) {
+ doSetProperty("exchangeFormatter", exchangeFormatter);
+ return this;
+ }
}
class DatasetComponentBuilderImpl
@@ -136,7 +172,9 @@ public interface DatasetComponentBuilderFactory {
switch (name) {
case "bridgeErrorHandler": ((DataSetComponent)
component).setBridgeErrorHandler((boolean) value); return true;
case "lazyStartProducer": ((DataSetComponent)
component).setLazyStartProducer((boolean) value); return true;
+ case "log": ((DataSetComponent) component).setLog((boolean)
value); return true;
case "autowiredEnabled": ((DataSetComponent)
component).setAutowiredEnabled((boolean) value); return true;
+ case "exchangeFormatter": ((DataSetComponent)
component).setExchangeFormatter((org.apache.camel.spi.ExchangeFormatter)
value); return true;
default: return false;
}
}
diff --git
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetTestComponentBuilderFactory.java
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetTestComponentBuilderFactory.java
index fd25992..7bebe6c 100644
---
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetTestComponentBuilderFactory.java
+++
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/DatasetTestComponentBuilderFactory.java
@@ -77,6 +77,24 @@ public interface DatasetTestComponentBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DatasetTestComponentBuilder log(boolean log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* 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,
@@ -97,6 +115,24 @@ public interface DatasetTestComponentBuilderFactory {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
+ /**
+ * Sets a custom ExchangeFormatter to convert the Exchange to a String
+ * suitable for logging. If not specified, we default to
+ * DefaultExchangeFormatter.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.ExchangeFormatter</code>
type.
+ *
+ * Group: advanced
+ *
+ * @param exchangeFormatter the value to set
+ * @return the dsl builder
+ */
+ default DatasetTestComponentBuilder exchangeFormatter(
+ org.apache.camel.spi.ExchangeFormatter exchangeFormatter) {
+ doSetProperty("exchangeFormatter", exchangeFormatter);
+ return this;
+ }
}
class DatasetTestComponentBuilderImpl
@@ -115,7 +151,9 @@ public interface DatasetTestComponentBuilderFactory {
Object value) {
switch (name) {
case "lazyStartProducer": ((DataSetTestComponent)
component).setLazyStartProducer((boolean) value); return true;
+ case "log": ((DataSetTestComponent) component).setLog((boolean)
value); return true;
case "autowiredEnabled": ((DataSetTestComponent)
component).setAutowiredEnabled((boolean) value); return true;
+ case "exchangeFormatter": ((DataSetTestComponent)
component).setExchangeFormatter((org.apache.camel.spi.ExchangeFormatter)
value); return true;
default: return false;
}
}
diff --git
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MockComponentBuilderFactory.java
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MockComponentBuilderFactory.java
index 17fbfbe..2ffd5c8 100644
---
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MockComponentBuilderFactory.java
+++
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MockComponentBuilderFactory.java
@@ -72,6 +72,24 @@ public interface MockComponentBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default MockComponentBuilder log(boolean log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* 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,
@@ -91,6 +109,24 @@ public interface MockComponentBuilderFactory {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
+ /**
+ * Sets a custom ExchangeFormatter to convert the Exchange to a String
+ * suitable for logging. If not specified, we default to
+ * DefaultExchangeFormatter.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.ExchangeFormatter</code>
type.
+ *
+ * Group: advanced
+ *
+ * @param exchangeFormatter the value to set
+ * @return the dsl builder
+ */
+ default MockComponentBuilder exchangeFormatter(
+ org.apache.camel.spi.ExchangeFormatter exchangeFormatter) {
+ doSetProperty("exchangeFormatter", exchangeFormatter);
+ return this;
+ }
}
class MockComponentBuilderImpl
@@ -109,7 +145,9 @@ public interface MockComponentBuilderFactory {
Object value) {
switch (name) {
case "lazyStartProducer": ((MockComponent)
component).setLazyStartProducer((boolean) value); return true;
+ case "log": ((MockComponent) component).setLog((boolean) value);
return true;
case "autowiredEnabled": ((MockComponent)
component).setAutowiredEnabled((boolean) value); return true;
+ case "exchangeFormatter": ((MockComponent)
component).setExchangeFormatter((org.apache.camel.spi.ExchangeFormatter)
value); return true;
default: return false;
}
}
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentLogTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentLogTest.java
new file mode 100644
index 0000000..f617422
--- /dev/null
+++
b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentLogTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mock;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class MockComponentLogTest extends ContextTestSupport {
+
+ @Test
+ public void testLog() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:foo");
+ mock.expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ MockComponent mock = context.getComponent("mock",
MockComponent.class);
+ mock.setLog(true);
+
+ from("direct:start").to("mock:foo");
+ }
+ };
+ }
+}
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/mock/MockLogTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockLogTest.java
new file mode 100644
index 0000000..88b46f4
--- /dev/null
+++
b/core/camel-core/src/test/java/org/apache/camel/component/mock/MockLogTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.mock;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class MockLogTest extends ContextTestSupport {
+
+ @Test
+ public void testLog() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:foo?log=true");
+ mock.expectedMessageCount(3);
+
+ template.sendBody("direct:start", "Hello World");
+ template.sendBody("direct:start", "Bye World");
+ template.sendBody("direct:start", "Hi World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").to("mock:foo?log=true");
+ }
+ };
+ }
+}
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetEndpointBuilderFactory.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetEndpointBuilderFactory.java
index 9782a26..a8723e6 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetEndpointBuilderFactory.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetEndpointBuilderFactory.java
@@ -562,6 +562,43 @@ public interface DataSetEndpointBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>org.slf4j.Logger</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DataSetEndpointProducerBuilder log(Object log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option will be converted to a
+ * <code>org.slf4j.Logger</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DataSetEndpointProducerBuilder log(String log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* A number that is used to turn on throughput logging based on groups
* of the size.
*
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetTestEndpointBuilderFactory.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetTestEndpointBuilderFactory.java
index 72b387b..2554696 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetTestEndpointBuilderFactory.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DataSetTestEndpointBuilderFactory.java
@@ -274,6 +274,43 @@ public interface DataSetTestEndpointBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DataSetTestEndpointBuilder log(boolean log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default DataSetTestEndpointBuilder log(String log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* A number that is used to turn on throughput logging based on groups
* of the size.
*
diff --git
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MockEndpointBuilderFactory.java
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MockEndpointBuilderFactory.java
index b71cf7d..fe13a77 100644
---
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MockEndpointBuilderFactory.java
+++
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MockEndpointBuilderFactory.java
@@ -220,6 +220,43 @@ public interface MockEndpointBuilderFactory {
return this;
}
/**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default MockEndpointBuilder log(boolean log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
+ * To turn on logging when the mock receives an incoming message. This
+ * will log only one time at INFO level for the incoming message. For
+ * more detailed logging then set the logger to DEBUG level for the
+ * org.apache.camel.component.mock.MockEndpoint class.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param log the value to set
+ * @return the dsl builder
+ */
+ default MockEndpointBuilder log(String log) {
+ doSetProperty("log", log);
+ return this;
+ }
+ /**
* A number that is used to turn on throughput logging based on groups
* of the size.
*
diff --git
a/core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationCustomMBeanTest.java
b/core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationCustomMBeanTest.java
index 4eaea90..bf0853c 100644
---
a/core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationCustomMBeanTest.java
+++
b/core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationCustomMBeanTest.java
@@ -26,7 +26,7 @@ import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.direct.DirectEndpoint;
-import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.component.mock.MockComponent;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -118,7 +118,7 @@ public class JmxInstrumentationCustomMBeanTest extends
JmxInstrumentationUsingDe
};
}
- private static class CustomComponent extends DefaultComponent {
+ private static class CustomComponent extends MockComponent {
@Override
protected Endpoint createEndpoint(final String uri, final String
remaining, final Map<String, Object> parameters)
throws Exception {
diff --git a/docs/components/modules/ROOT/pages/dataset-component.adoc
b/docs/components/modules/ROOT/pages/dataset-component.adoc
index e71b2f6..76c5132 100644
--- a/docs/components/modules/ROOT/pages/dataset-component.adoc
+++ b/docs/components/modules/ROOT/pages/dataset-component.adoc
@@ -57,7 +57,7 @@ extend `DataSetSupport`.
// component options: START
-The Dataset component supports 3 options, which are listed below.
+The Dataset component supports 5 options, which are listed below.
@@ -66,7 +66,9 @@ The Dataset component supports 3 options, which are listed
below.
| Name | Description | Default | Type
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the
Camel routing Error Handler, which mean any exceptions occurred while the
consumer is trying to pickup incoming messages, or the likes, will now be
processed as a message and handled by the routing Error Handler. 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. | false |
boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -91,7 +93,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (20 parameters):
+=== Query Parameters (21 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -110,6 +112,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git a/docs/components/modules/ROOT/pages/dataset-test-component.adoc
b/docs/components/modules/ROOT/pages/dataset-test-component.adoc
index f79398a..c8ed978 100644
--- a/docs/components/modules/ROOT/pages/dataset-test-component.adoc
+++ b/docs/components/modules/ROOT/pages/dataset-test-component.adoc
@@ -53,7 +53,7 @@ pulled from before starting the test.
== URI Options
// component options: START
-The DataSet Test component supports 2 options, which are listed below.
+The DataSet Test component supports 4 options, which are listed below.
@@ -61,7 +61,9 @@ The DataSet Test component supports 2 options, which are
listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -85,7 +87,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (15 parameters):
+=== Query Parameters (16 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -97,6 +99,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long
diff --git a/docs/components/modules/ROOT/pages/mock-component.adoc
b/docs/components/modules/ROOT/pages/mock-component.adoc
index c9f1528..5f002e5 100644
--- a/docs/components/modules/ROOT/pages/mock-component.adoc
+++ b/docs/components/modules/ROOT/pages/mock-component.adoc
@@ -91,7 +91,7 @@ You can append query options to the URI in the following
format,
// component options: START
-The Mock component supports 2 options, which are listed below.
+The Mock component supports 4 options, which are listed below.
@@ -99,7 +99,9 @@ The Mock component supports 2 options, which are listed below.
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *autowiredEnabled* (advanced) | 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. | true | boolean
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter
to convert the Exchange to a String suitable for logging. If not specified, we
default to DefaultExchangeFormatter. | | ExchangeFormatter
|===
// component options: END
@@ -127,7 +129,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -137,6 +139,7 @@ with the following path and query parameters:
| *expectedCount* (producer) | Specifies the expected number of message
exchanges that should be received by this endpoint. Beware: If you want to
expect that 0 messages, then take extra care, as 0 matches when the tests
starts, so you need to set a assert period time to let the test run for a while
to make sure there are still no messages arrived; for that use
setAssertPeriod(long). An alternative is to use NotifyBuilder, and use the
notifier to know when Camel is done routing some mess [...]
| *failFast* (producer) | Sets whether assertIsSatisfied() should fail fast at
the first detected failed expectation while it may otherwise wait for all
expected messages to arrive before performing expectations verifications. Is by
default true. Set to false to use behavior as in Camel 2.x. | false | boolean
| *lazyStartProducer* (producer) | 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 [...]
+| *log* (producer) | To turn on logging when the mock receives an incoming
message. This will log only one time at INFO level for the incoming message.
For more detailed logging then set the logger to DEBUG level for the
org.apache.camel.component.mock.MockEndpoint class. | false | boolean
| *reportGroup* (producer) | A number that is used to turn on throughput
logging based on groups of the size. | | int
| *resultMinimumWaitTime* (producer) | Sets the minimum expected amount of
time (in millis) the assertIsSatisfied() will wait on a latch until it is
satisfied | 0 | long
| *resultWaitTime* (producer) | Sets the maximum amount of time (in millis)
the assertIsSatisfied() will wait on a latch until it is satisfied | 0 | long