-
Notifications
You must be signed in to change notification settings - Fork 5.2k
CAMEL-24373: Add camel-alibaba MVP (common, OSS, MNS) — phase 1 #25433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
atiaomar1978-hub
wants to merge
10
commits into
apache:main
Choose a base branch
from
atiaomar1978-hub:feature/CAMEL-24373-alibaba-phase1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a1062a2
CAMEL-24373: Add camel-alibaba-oss component (phase 1 MVP)
cursoragent aea1eaf
CAMEL-24373: Add camel-alibaba-mns component (MVP phase 1)
cursoragent 47a3d15
CAMEL-24373: Wire camel-alibaba modules into build and add ClientRegi…
cursoragent fbd683f
CAMEL-24373: Fix AlibabaClientRegistry generic compilation
cursoragent a19ba45
CAMEL-24373: Address review findings and regenerate catalog
cursoragent f04e69f
CAMEL-24373: Address PR review feedback for camel-alibaba phase 1
cursoragent a83c650
CAMEL-24373: Regenerate catalog after OSS header and MNS doc updates
cursoragent 60d2116
CAMEL-24373: Fix credential resolution, listObjects cap, and MNS clie…
cursoragent 06fb763
CAMEL-24373: Add endpoint lifecycle and credential precedence tests
cursoragent 1554797
CAMEL-24373: Rebase on main and bump component version to 4.23.0
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ a2a | |
| activemq | ||
| activemq6 | ||
| ai-tool | ||
| alibaba-mns | ||
| alibaba-oss | ||
| amqp | ||
| arangodb | ||
| as2 | ||
|
|
||
79 changes: 79 additions & 0 deletions
79
...amel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-mns.json
Large diffs are not rendered by default.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
...amel-catalog/src/generated/resources/org/apache/camel/catalog/components/alibaba-oss.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
...rc/generated/resources/org/apache/camel/catalog/docs/alibaba-mns-component.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| = Alibaba Message Service (MNS) Component | ||
| :doctitle: Alibaba Message Service (MNS) | ||
| :shortname: alibaba-mns | ||
| :artifactid: camel-alibaba-mns | ||
| :description: Send and receive messages to/from Alibaba Cloud Message Service (MNS). | ||
| :since: 4.23 | ||
| :supportlevel: Preview | ||
| :tabs-sync-option: | ||
| :component-header: Both producer and consumer are supported | ||
| //Manually maintained attributes | ||
| :group: Alibaba Cloud | ||
|
|
||
| *Since Camel {since}* | ||
|
|
||
| *{component-header}* | ||
|
|
||
| The Alibaba Cloud Message Service (MNS) component allows you to integrate with | ||
| https://www.alibabacloud.com/product/mns[Alibaba Cloud MNS] for queue and topic messaging. | ||
|
|
||
| NOTE: Alibaba Cloud recommends RocketMQ for new messaging workloads. MNS remains supported, | ||
| but evaluate https://www.alibabacloud.com/product/rocketmq[RocketMQ] or the Camel RocketMQ | ||
| component for greenfield projects. | ||
|
|
||
| Maven users will need to add the following dependency to their `pom.xml` | ||
| for this component: | ||
|
|
||
| [source,xml] | ||
| ---- | ||
| <dependency> | ||
| <groupId>org.apache.camel</groupId> | ||
| <artifactId>camel-alibaba-mns</artifactId> | ||
| <version>x.x.x</version> | ||
| <!-- use the same version as your Camel core version --> | ||
| </dependency> | ||
| ---- | ||
|
|
||
| == URI format | ||
|
|
||
| Queue endpoints: | ||
|
|
||
| [source] | ||
| ---- | ||
| alibaba-mns:queueName[?options] | ||
| ---- | ||
|
|
||
| Topic endpoints: | ||
|
|
||
| [source] | ||
| ---- | ||
| alibaba-mns:topic:topicName[?options] | ||
| ---- | ||
|
|
||
| // component options: START | ||
| include::partial$component-configure-options.adoc[] | ||
| include::partial$component-endpoint-options.adoc[] | ||
| include::partial$component-endpoint-headers.adoc[] | ||
| // component options: END | ||
|
|
||
| == Usage | ||
|
|
||
| === Operations | ||
|
|
||
| The component supports the following operations: | ||
|
|
||
| * `sendMessage` - send a message to a queue (producer) | ||
| * `receiveMessage` - receive messages from a queue (consumer) | ||
| * `deleteMessage` - delete a message from a queue using its receipt handle (producer) | ||
| * `publishMessage` - publish a message to a topic (producer) | ||
|
|
||
| === Queue producer example | ||
|
|
||
| [source,java] | ||
| ---- | ||
| from("direct:start") | ||
| .setBody(constant("Hello MNS")) | ||
| .to("alibaba-mns:myQueue?operation=sendMessage®ion=cn-hangzhou&accountEndpoint=https://123456.mns.cn-hangzhou.aliyuncs.com&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); | ||
| ---- | ||
|
|
||
| === Topic producer example | ||
|
|
||
| [source,java] | ||
| ---- | ||
| from("direct:start") | ||
| .setBody(constant("Hello Topic")) | ||
| .to("alibaba-mns:topic:myTopic?operation=publishMessage®ion=cn-hangzhou&accountEndpoint=https://123456.mns.cn-hangzhou.aliyuncs.com&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)"); | ||
| ---- | ||
|
|
||
| === Queue consumer example | ||
|
|
||
| [source,java] | ||
| ---- | ||
| from("alibaba-mns:myQueue?region=cn-hangzhou&accountEndpoint=https://123456.mns.cn-hangzhou.aliyuncs.com&accessKey=RAW(accessKey)&secretKey=RAW(secretKey)&deleteAfterRead=true") | ||
| .to("bean:processMessage"); | ||
| ---- | ||
|
|
||
| === Exchange properties evaluated by the producer | ||
|
|
||
| [width="100%",cols="10%,10%,80%",options="header",] | ||
| |======================================================================= | ||
| |Property |Type |Description | ||
|
|
||
| |`CamelAlibabaMnsOperation` |`String` |Operation to perform | ||
|
|
||
| |`CamelAlibabaMnsQueueName` |`String` |Queue name override | ||
|
|
||
| |`CamelAlibabaMnsTopicName` |`String` |Topic name for publish operations | ||
|
|
||
| |`CamelAlibabaMnsReceiptHandle` |`String` |Receipt handle for delete operations | ||
|
|
||
| |======================================================================= | ||
|
|
||
| === Exchange properties set by the producer | ||
|
|
||
| [width="100%",cols="10%,10%,80%",options="header",] | ||
| |======================================================================= | ||
| |Property |Type |Description | ||
|
|
||
| |`CamelAlibabaMnsMessageId` |`String` |Message id returned by MNS | ||
|
|
||
| |`CamelAlibabaMnsRequestId` |`String` |Request id returned by MNS | ||
|
|
||
| |`CamelAlibabaMnsMessageBodyMd5` |`String` |MD5 digest of the message body | ||
|
|
||
| |======================================================================= | ||
|
|
||
| == Examples | ||
|
|
||
| For more examples, see the unit tests in the `camel-alibaba-mns` module. |
102 changes: 102 additions & 0 deletions
102
...rc/generated/resources/org/apache/camel/catalog/docs/alibaba-oss-component.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| = Alibaba Object Storage Service (OSS) Component | ||
| :doctitle: Alibaba Object Storage Service (OSS) | ||
| :shortname: alibaba-oss | ||
| :artifactid: camel-alibaba-oss | ||
| :description: Alibaba Cloud Object Storage Service (OSS) component | ||
| :since: 4.23 | ||
| :supportlevel: Preview | ||
| :tabs-sync-option: | ||
| :component-header: Both producer and consumer are supported | ||
| //Manually maintained attributes | ||
| :group: Alibaba Cloud | ||
|
|
||
| *Since Camel {since}* | ||
|
|
||
| *{component-header}* | ||
|
|
||
| The Alibaba Cloud Object Storage Service (OSS) component allows you to integrate with https://www.alibabacloud.com/product/object-storage-service[Alibaba Cloud OSS]. | ||
|
|
||
| Maven users will need to add the following dependency to their `pom.xml` for this component: | ||
|
|
||
| [source,xml] | ||
| ---- | ||
| <dependency> | ||
| <groupId>org.apache.camel</groupId> | ||
| <artifactId>camel-alibaba-oss</artifactId> | ||
| <version>x.x.x</version> | ||
| <!-- use the same version as your Camel core version --> | ||
| </dependency> | ||
| ---- | ||
|
|
||
| == URI Format | ||
|
|
||
| ---- | ||
| alibaba-oss:operation[?options] | ||
| ---- | ||
|
|
||
| // component options: START | ||
| include::partial$component-configure-options.adoc[] | ||
| include::partial$component-endpoint-options.adoc[] | ||
| include::partial$component-endpoint-headers.adoc[] | ||
| // component options: END | ||
|
|
||
| == Usage | ||
|
|
||
| === Message properties evaluated by the OSS producer | ||
|
|
||
| [width="100%",cols="10%,10%,80%",options="header",] | ||
| |======================================================================= | ||
| |Header |Type |Description | ||
|
|
||
| |`CamelAlibabaOssOperation` |`String` | Name of operation to invoke | ||
|
|
||
| |`CamelAlibabaOssBucketName` |`String` | Bucket name to invoke operation on | ||
|
|
||
| |`CamelAlibabaOssObjectName` |`String` | Name of the object to be used in operation | ||
|
|
||
| |`CamelAlibabaOssSourceBucketName` |`String` | Source bucket name for copy operations | ||
|
|
||
| |`CamelAlibabaOssSourceObjectName` |`String` | Source object name for copy operations | ||
|
|
||
| |`CamelAlibabaOssPrefix` |`String` | Prefix filter when listing objects | ||
|
|
||
| |`CamelAlibabaOssMaxKeys` |`Integer` | Maximum number of keys returned when listing objects | ||
|
|
||
| |======================================================================= | ||
|
|
||
| If any of the above properties are set, they will override their corresponding query parameter. | ||
|
|
||
| === List of Supported OSS Operations | ||
|
|
||
| - listBuckets | ||
| - listObjects - `bucketName` parameter is *required* | ||
| - putObject - `bucketName` and `objectName` parameters are *required* (unless uploading a `File`) | ||
| - getObject - `bucketName` and `objectName` parameters are *required* | ||
| - deleteObject - `bucketName` and `objectName` parameters are *required* | ||
| - copyObject - source and destination bucket/object names are *required* | ||
| - headObject - `bucketName` and `objectName` parameters are *required* | ||
|
|
||
| === Consumer | ||
|
|
||
| The consumer polls objects from a bucket using `listObjectsV2`, downloads each object body, and optionally deletes objects after they have been processed when `deleteAfterRead` is enabled. | ||
|
|
||
| == Examples | ||
|
|
||
| === Put an object | ||
|
|
||
| [source,java] | ||
| ---- | ||
| from("direct:start") | ||
| .setBody(constant("Hello OSS")) | ||
| .setProperty("CamelAlibabaOssBucketName", constant("my-bucket")) | ||
| .setProperty("CamelAlibabaOssObjectName", constant("hello.txt")) | ||
| .to("alibaba-oss:putObject?region=cn-hangzhou&accessKey=xxx&secretKey=yyy"); | ||
| ---- | ||
|
|
||
| === Consume objects from a bucket | ||
|
|
||
| [source,java] | ||
| ---- | ||
| from("alibaba-oss:consumer?bucketName=my-bucket®ion=cn-hangzhou&accessKey=xxx&secretKey=yyy&deleteAfterRead=true") | ||
| .to("log:output"); | ||
| ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
|
|
||
| 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. | ||
|
|
||
| --> | ||
| <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/xsd/maven-4.0.0.xsd"> | ||
|
|
||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.apache.camel</groupId> | ||
| <artifactId>camel-alibaba-parent</artifactId> | ||
| <version>4.23.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <properties> | ||
| <firstVersion>4.23.0</firstVersion> | ||
| </properties> | ||
|
|
||
| <artifactId>camel-alibaba-common</artifactId> | ||
| <packaging>jar</packaging> | ||
| <name>Camel :: Alibaba Cloud :: Common</name> | ||
| <description>Common utilities for Camel Alibaba Cloud components</description> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.camel</groupId> | ||
| <artifactId>camel-support</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| </project> |
7 changes: 7 additions & 0 deletions
7
...libaba-common/src/generated/resources/META-INF/services/org/apache/camel/other.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Generated by camel build tools - do NOT edit this file! | ||
| name=alibaba-common | ||
| groupId=org.apache.camel | ||
| artifactId=camel-alibaba-common | ||
| version=4.23.0-SNAPSHOT | ||
| projectName=Camel :: Alibaba Cloud :: Common | ||
| projectDescription=Common utilities for Camel Alibaba Cloud components |
14 changes: 14 additions & 0 deletions
14
components/camel-alibaba/camel-alibaba-common/src/generated/resources/alibaba-common.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "other": { | ||
| "kind": "other", | ||
| "name": "alibaba-common", | ||
| "title": "Alibaba Common", | ||
| "description": "Common utilities for Camel Alibaba Cloud components", | ||
| "deprecated": false, | ||
| "firstVersion": "4.23.0", | ||
| "supportLevel": "Preview", | ||
| "groupId": "org.apache.camel", | ||
| "artifactId": "camel-alibaba-common", | ||
| "version": "4.23.0-SNAPSHOT" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking: The three new BOM entries hardcode
4.22.0-SNAPSHOTinstead of4.23.0-SNAPSHOT. Theparent/pom.xmland all modulepom.xmlfiles correctly use4.23.0-SNAPSHOT. This version mismatch will break dependency management for any project importing the Camel BOM.Note: the Camel BOM uses hardcoded versions (not
${project.version}), so these must match the current project version.