Skip to content

Commit 7e7c284

Browse files
committed
Add Camel Iggy SB Starter
1 parent b24bea6 commit 7e7c284

File tree

13 files changed

+1133
-0
lines changed

13 files changed

+1133
-0
lines changed

catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ hwcloud-smn
156156
ibm-secrets-manager
157157
iec60870-client
158158
iec60870-server
159+
iggy
159160
ignite-cache
160161
ignite-compute
161162
ignite-events

catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/iggy.json

Lines changed: 85 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one or more
5+
contributor license agreements. See the NOTICE file distributed with
6+
this work for additional information regarding copyright ownership.
7+
The ASF licenses this file to You under the Apache License, Version 2.0
8+
(the "License"); you may not use this file except in compliance with
9+
the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.apache.camel.springboot</groupId>
24+
<artifactId>components-starter</artifactId>
25+
<version>4.14.0-SNAPSHOT</version>
26+
</parent>
27+
<artifactId>camel-iggy-starter</artifactId>
28+
<packaging>jar</packaging>
29+
<name>Camel SB Starters :: iggy</name>
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter</artifactId>
34+
<version>${spring-boot-version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.apache.camel</groupId>
38+
<artifactId>camel-iggy</artifactId>
39+
<version>${camel-version}</version>
40+
</dependency>
41+
<!--START OF GENERATED CODE-->
42+
<dependency>
43+
<groupId>org.apache.camel.springboot</groupId>
44+
<artifactId>camel-core-starter</artifactId>
45+
</dependency>
46+
<!--END OF GENERATED CODE-->
47+
</dependencies>
48+
</project>
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
{
2+
"groups": [
3+
{
4+
"name": "camel.component.iggy",
5+
"type": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
6+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
7+
},
8+
{
9+
"name": "camel.component.iggy.customizer",
10+
"type": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties",
11+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
12+
"sourceMethod": "getCustomizer()"
13+
}
14+
],
15+
"properties": [
16+
{
17+
"name": "camel.component.iggy.auto-commit",
18+
"type": "java.lang.Boolean",
19+
"description": "Controls message acknowledgment behavior. When true, messages are automatically marked as processed after consumption. When false, enables manual offset management and allows setting a custom starting offset position",
20+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
21+
"defaultValue": true
22+
},
23+
{
24+
"name": "camel.component.iggy.auto-create-stream",
25+
"type": "java.lang.Boolean",
26+
"description": "Whether to automatically create stream if it does not exist",
27+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
28+
"defaultValue": true
29+
},
30+
{
31+
"name": "camel.component.iggy.auto-create-topic",
32+
"type": "java.lang.Boolean",
33+
"description": "Whether to automatically create topic if it does not exist",
34+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
35+
"defaultValue": true
36+
},
37+
{
38+
"name": "camel.component.iggy.autowired-enabled",
39+
"type": "java.lang.Boolean",
40+
"description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.",
41+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
42+
"defaultValue": true
43+
},
44+
{
45+
"name": "camel.component.iggy.bridge-error-handler",
46+
"type": "java.lang.Boolean",
47+
"description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.",
48+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
49+
"defaultValue": false
50+
},
51+
{
52+
"name": "camel.component.iggy.client-transport",
53+
"type": "java.lang.String",
54+
"description": "Polling strategy",
55+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
56+
"defaultValue": "TCP"
57+
},
58+
{
59+
"name": "camel.component.iggy.compression-algorithm",
60+
"type": "org.apache.iggy.topic.CompressionAlgorithm",
61+
"description": "Compression algorithm for message payload",
62+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
63+
"defaultValue": "none"
64+
},
65+
{
66+
"name": "camel.component.iggy.configuration",
67+
"type": "org.apache.camel.component.iggy.IggyConfiguration",
68+
"description": "Allows to pre-configure the Iggy component with common options that the endpoints will reuse. The option is a org.apache.camel.component.iggy.IggyConfiguration type.",
69+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
70+
},
71+
{
72+
"name": "camel.component.iggy.consumer-group-name",
73+
"type": "java.lang.String",
74+
"description": "The name of the consumer group",
75+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
76+
},
77+
{
78+
"name": "camel.component.iggy.consumers-count",
79+
"type": "java.lang.Integer",
80+
"description": "Camel Iggy consumers count",
81+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
82+
"defaultValue": 1
83+
},
84+
{
85+
"name": "camel.component.iggy.customizer.enabled",
86+
"type": "java.lang.Boolean",
87+
"sourceType": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties"
88+
},
89+
{
90+
"name": "camel.component.iggy.enabled",
91+
"type": "java.lang.Boolean",
92+
"description": "Whether to enable auto configuration of the iggy component. This is enabled by default.",
93+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
94+
},
95+
{
96+
"name": "camel.component.iggy.host",
97+
"type": "java.lang.String",
98+
"description": "Iggy server hostname or IP address",
99+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
100+
"defaultValue": "localhost"
101+
},
102+
{
103+
"name": "camel.component.iggy.lazy-start-producer",
104+
"type": "java.lang.Boolean",
105+
"description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.",
106+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
107+
"defaultValue": false
108+
},
109+
{
110+
"name": "camel.component.iggy.max-topic-size",
111+
"type": "java.lang.Long",
112+
"description": "Maximum topic size in bytes (0 means unlimited)",
113+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
114+
"defaultValue": 0
115+
},
116+
{
117+
"name": "camel.component.iggy.message-expiry",
118+
"type": "java.lang.Long",
119+
"description": "Message expiry time in seconds (0 means no expiry)",
120+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
121+
"defaultValue": 0
122+
},
123+
{
124+
"name": "camel.component.iggy.partition-id",
125+
"type": "java.lang.Long",
126+
"description": "The consumer partition id",
127+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
128+
},
129+
{
130+
"name": "camel.component.iggy.partitioning",
131+
"type": "org.apache.iggy.message.Partitioning",
132+
"description": "Partitioning strategy for message distribution. The option is a org.apache.iggy.message.Partitioning type.",
133+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
134+
},
135+
{
136+
"name": "camel.component.iggy.partitions-count",
137+
"type": "java.lang.Long",
138+
"description": "Number of partitions for the topic",
139+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
140+
"defaultValue": 1
141+
},
142+
{
143+
"name": "camel.component.iggy.password",
144+
"type": "java.lang.String",
145+
"description": "Iggy password",
146+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
147+
},
148+
{
149+
"name": "camel.component.iggy.poll-batch-size",
150+
"type": "java.lang.Long",
151+
"description": "The consumer poll batch size",
152+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
153+
"defaultValue": 10
154+
},
155+
{
156+
"name": "camel.component.iggy.polling-strategy",
157+
"type": "java.lang.String",
158+
"description": "Polling strategy",
159+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
160+
"defaultValue": "next"
161+
},
162+
{
163+
"name": "camel.component.iggy.port",
164+
"type": "java.lang.Integer",
165+
"description": "Iggy server port number",
166+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
167+
"defaultValue": 8090
168+
},
169+
{
170+
"name": "camel.component.iggy.replication-factor",
171+
"type": "java.lang.Short",
172+
"description": "Replication factor for the topic",
173+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
174+
},
175+
{
176+
"name": "camel.component.iggy.shutdown-timeout",
177+
"type": "java.lang.Integer",
178+
"description": "Camel Iggy shutdown timeout",
179+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
180+
"defaultValue": 30000
181+
},
182+
{
183+
"name": "camel.component.iggy.starting-offset",
184+
"type": "java.lang.Long",
185+
"description": "Defines the initial message offset position when autoCommit is disabled. Use 0 to start from the beginning of the stream, or specify a custom offset to resume from a particular point",
186+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration",
187+
"defaultValue": 0
188+
},
189+
{
190+
"name": "camel.component.iggy.stream-id",
191+
"type": "java.lang.Long",
192+
"description": "Stream identifier",
193+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
194+
},
195+
{
196+
"name": "camel.component.iggy.stream-name",
197+
"type": "java.lang.String",
198+
"description": "Stream name",
199+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
200+
},
201+
{
202+
"name": "camel.component.iggy.username",
203+
"type": "java.lang.String",
204+
"description": "Iggy username",
205+
"sourceType": "org.apache.camel.component.iggy.springboot.IggyComponentConfiguration"
206+
}
207+
],
208+
"hints": [],
209+
"ignored": {
210+
"properties": []
211+
}
212+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.camel.component.iggy.springboot;
18+
19+
import org.apache.camel.CamelContext;
20+
import org.apache.camel.Component;
21+
import org.apache.camel.component.iggy.IggyComponent;
22+
import org.apache.camel.spi.ComponentCustomizer;
23+
import org.apache.camel.spring.boot.CamelAutoConfiguration;
24+
import org.apache.camel.spring.boot.ComponentConfigurationProperties;
25+
import org.apache.camel.spring.boot.util.CamelPropertiesHelper;
26+
import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
27+
import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties;
28+
import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
29+
import org.springframework.beans.factory.annotation.Autowired;
30+
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
31+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
32+
import org.springframework.context.ApplicationContext;
33+
import org.springframework.context.annotation.Bean;
34+
import org.springframework.context.annotation.Conditional;
35+
import org.springframework.context.annotation.Configuration;
36+
import org.springframework.context.annotation.Lazy;
37+
38+
/**
39+
* Generated by camel-package-maven-plugin - do not edit this file!
40+
*/
41+
@Configuration(proxyBeanMethods = false)
42+
@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
43+
@EnableConfigurationProperties({ComponentConfigurationProperties.class,IggyComponentConfiguration.class})
44+
@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.iggy"})
45+
@AutoConfigureAfter({CamelAutoConfiguration.class, IggyComponentConverter.class})
46+
public class IggyComponentAutoConfiguration {
47+
48+
@Autowired
49+
private ApplicationContext applicationContext;
50+
private final CamelContext camelContext;
51+
@Autowired
52+
private IggyComponentConfiguration configuration;
53+
54+
public IggyComponentAutoConfiguration(
55+
org.apache.camel.CamelContext camelContext) {
56+
this.camelContext = camelContext;
57+
}
58+
59+
@Lazy
60+
@Bean
61+
public ComponentCustomizer configureIggyComponent() {
62+
return new ComponentCustomizer() {
63+
@Override
64+
public void configure(String name, Component target) {
65+
CamelPropertiesHelper.copyProperties(camelContext, configuration, target);
66+
}
67+
@Override
68+
public boolean isEnabled(String name, Component target) {
69+
return HierarchicalPropertiesEvaluator.evaluate(
70+
applicationContext,
71+
"camel.component.customizer",
72+
"camel.component.iggy.customizer")
73+
&& target instanceof IggyComponent;
74+
}
75+
};
76+
}
77+
}

0 commit comments

Comments
 (0)