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 dbfcd586877c Upgrade to iggy 0.7 (#21806)
dbfcd586877c is described below
commit dbfcd586877c3268aacd9e3e823dc060606900a3
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Mar 8 09:58:00 2026 +0100
Upgrade to iggy 0.7 (#21806)
* Upgrade to iggy 0.7
---
.../org/apache/camel/catalog/components/iggy.json | 2 +-
components/camel-iggy/pom.xml | 1 +
.../org/apache/camel/component/iggy/iggy.json | 2 +-
.../camel-iggy/src/main/docs/iggy-component.adoc | 2 +-
.../camel/component/iggy/IggyFetchRecords.java | 15 ++++++-----
.../iggy/client/IggyClientConnectionPool.java | 1 +
.../component/iggy/client/IggyClientFactory.java | 29 +++++++---------------
.../apache/camel/component/iggy/IggyTestBase.java | 5 ++--
parent/pom.xml | 2 +-
.../test/infra/iggy/services/container.properties | 2 +-
10 files changed, 26 insertions(+), 35 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json
index c34711778aea..a02841bf6512 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json
@@ -8,7 +8,7 @@
"firstVersion": "4.17.0",
"label": "messaging",
"javaType": "org.apache.camel.component.iggy.IggyComponent",
- "supportLevel": "Stable",
+ "supportLevel": "Preview",
"groupId": "org.apache.camel",
"artifactId": "camel-iggy",
"version": "4.19.0-SNAPSHOT",
diff --git a/components/camel-iggy/pom.xml b/components/camel-iggy/pom.xml
index a851be769ccd..a05653c3326c 100644
--- a/components/camel-iggy/pom.xml
+++ b/components/camel-iggy/pom.xml
@@ -33,6 +33,7 @@
<properties>
<iggy-netty-version>4.2.7.Final</iggy-netty-version>
+ <supportLevel>Preview</supportLevel>
</properties>
<!-- Iggy client 0.6.0 requires Netty 4.2.x for
MultiThreadIoEventLoopGroup -->
diff --git
a/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json
b/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json
index c34711778aea..a02841bf6512 100644
---
a/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json
+++
b/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json
@@ -8,7 +8,7 @@
"firstVersion": "4.17.0",
"label": "messaging",
"javaType": "org.apache.camel.component.iggy.IggyComponent",
- "supportLevel": "Stable",
+ "supportLevel": "Preview",
"groupId": "org.apache.camel",
"artifactId": "camel-iggy",
"version": "4.19.0-SNAPSHOT",
diff --git a/components/camel-iggy/src/main/docs/iggy-component.adoc
b/components/camel-iggy/src/main/docs/iggy-component.adoc
index 29ea580ca739..1ddb9779aeb8 100644
--- a/components/camel-iggy/src/main/docs/iggy-component.adoc
+++ b/components/camel-iggy/src/main/docs/iggy-component.adoc
@@ -4,7 +4,7 @@
:artifactid: camel-iggy
:description: Send and receive message to Apache Iggy streaming platform.
:since: 4.17
-:supportlevel: Stable
+:supportlevel: Preview
:tabs-sync-option:
:component-header: Both producer and consumer are supported
//Manually maintained attributes
diff --git
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyFetchRecords.java
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyFetchRecords.java
index dd7b35efa151..4253fdcea54c 100644
---
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyFetchRecords.java
+++
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyFetchRecords.java
@@ -169,14 +169,13 @@ public class IggyFetchRecords implements Runnable {
exchange.getIn().setHeader(IggyConstants.MESSAGE_LENGTH,
message.header().payloadLength());
exchange.getIn().setHeader(IggyConstants.MESSAGE_SIZE,
message.getSize());
- message.userHeaders().ifPresent(userHeaders -> {
- Map<String, Object> stringUserHeaders =
userHeaders.entrySet().stream().collect(Collectors.toMap(
- k -> k.getKey(),
- hv -> hv.getValue().value() // TODO this way `HeaderKind
kind` will be lost
- ));
-
- exchange.getIn().setHeaders(stringUserHeaders);
- });
+ Map<String, Object> stringUserHeaders =
message.userHeaders().entrySet().stream().collect(Collectors.toMap(
+ k -> k.getKey().toString(),
+ hv -> hv.getValue().asString() // TODO this way `HeaderKind
kind` will be lost
+ ));
+ if (!stringUserHeaders.isEmpty()) {
+ exchange.getIn().getHeaders().putAll(stringUserHeaders);
+ }
return exchange;
}
diff --git
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientConnectionPool.java
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientConnectionPool.java
index 2387a2b9f93f..4455d213a54d 100644
---
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientConnectionPool.java
+++
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientConnectionPool.java
@@ -20,6 +20,7 @@ import org.apache.commons.pool2.impl.GenericObjectPool;
import org.apache.iggy.client.blocking.IggyBaseClient;
public class IggyClientConnectionPool {
+
private final GenericObjectPool<IggyBaseClient> pool;
public IggyClientConnectionPool(String host, int port, String username,
String password, String transport) {
diff --git
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java
index 2177e7cf7717..f0aa85e8126b 100644
---
a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java
+++
b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java
@@ -16,16 +16,15 @@
*/
package org.apache.camel.component.iggy.client;
-import org.apache.camel.RuntimeCamelException;
import org.apache.commons.pool2.BasePooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.apache.iggy.client.blocking.IggyBaseClient;
-import org.apache.iggy.client.blocking.IggyClientBuilder;
import org.apache.iggy.client.blocking.http.IggyHttpClient;
import org.apache.iggy.client.blocking.tcp.IggyTcpClient;
public class IggyClientFactory extends BasePooledObjectFactory<IggyBaseClient>
{
+
private final String host;
private final int port;
private final String username;
@@ -42,10 +41,14 @@ public class IggyClientFactory extends
BasePooledObjectFactory<IggyBaseClient> {
@Override
public IggyBaseClient create() throws Exception {
- IggyBaseClient iggyBaseClient = new
IggyClientBuilder().withBaseClient(createClient()).build().getBaseClient();
-
- loginIggyClient(iggyBaseClient);
-
+ IggyBaseClient iggyBaseClient;
+ if ("TCP".equalsIgnoreCase(transport)) {
+ iggyBaseClient =
IggyTcpClient.builder().host(host).port(port).credentials(username,
password).buildAndLogin();
+ } else if ("HTTP".equalsIgnoreCase(transport)) {
+ iggyBaseClient =
IggyHttpClient.builder().host(host).port(port).credentials(username,
password).buildAndLogin();
+ } else {
+ throw new IllegalArgumentException("Only HTTP or TCP transports
are supported");
+ }
return iggyBaseClient;
}
@@ -54,18 +57,4 @@ public class IggyClientFactory extends
BasePooledObjectFactory<IggyBaseClient> {
return new DefaultPooledObject<>(iggyBaseClient);
}
- private IggyBaseClient createClient() {
- return switch (transport) {
- case "HTTP" ->
- new IggyHttpClient(String.format("http://%s:%d", host, port));
- case "TCP" -> new IggyTcpClient(host, port);
- default -> throw new RuntimeCamelException("Only HTTP or TCP
transports are supported");
- };
- }
-
- private void loginIggyClient(IggyBaseClient client) {
- if (username != null) {
- client.users().login(username, password);
- }
- }
}
diff --git
a/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyTestBase.java
b/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyTestBase.java
index 29078243f830..81e20f7d0af1 100644
---
a/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyTestBase.java
+++
b/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyTestBase.java
@@ -59,8 +59,9 @@ public abstract class IggyTestBase {
@BeforeAll
public static void setup() {
- client = new IggyTcpClient(iggyService.host(), iggyService.port());
- client.users().login(iggyService.username(), iggyService.password());
+ client =
IggyTcpClient.builder().host(iggyService.host()).port(iggyService.port())
+ .credentials(iggyService.username(), iggyService.password())
+ .buildAndLogin();
}
@RouteFixture
diff --git a/parent/pom.xml b/parent/pom.xml
index 76b78a149305..dff78690a40e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -259,7 +259,7 @@
<ibm-watsonx-ai-sdk-version>0.18.0</ibm-watsonx-ai-sdk-version>
<ical4j-version>4.2.3</ical4j-version>
<icu4j-version>78.2</icu4j-version>
- <iggy-version>0.6.0</iggy-version>
+ <iggy-version>0.7.0</iggy-version>
<ignite-version>2.17.0</ignite-version>
<impsort-maven-plugin-version>1.13.0</impsort-maven-plugin-version>
<infinispan-version>16.0.3</infinispan-version>
diff --git
a/test-infra/camel-test-infra-iggy/src/main/resources/org/apache/camel/test/infra/iggy/services/container.properties
b/test-infra/camel-test-infra-iggy/src/main/resources/org/apache/camel/test/infra/iggy/services/container.properties
index 04fbacc994c7..dc8cf3b5cf34 100644
---
a/test-infra/camel-test-infra-iggy/src/main/resources/org/apache/camel/test/infra/iggy/services/container.properties
+++
b/test-infra/camel-test-infra-iggy/src/main/resources/org/apache/camel/test/infra/iggy/services/container.properties
@@ -14,4 +14,4 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-iggy.container=mirror.gcr.io/apache/iggy:0.6.0
+iggy.container=mirror.gcr.io/apache/iggy:0.7.0