Skip to content
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

[feature][connectors-v2][ActiveMQ] add ActiveMQ source connector #8581

Open
wants to merge 23 commits into
base: dev
Choose a base branch
from

Conversation

L-Gryps
Copy link
Contributor

@L-Gryps L-Gryps commented Jan 23, 2025

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 76 to 69
@Override
public TableSink createSink(TableSinkFactoryContext context) {
return () -> new ActivemqSink(context.getOptions(), context.getCatalogTable());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import static org.apache.seatunnel.connectors.seatunnel.activemq.config.ActivemqConfig.SCHEMA;
import static org.apache.seatunnel.connectors.seatunnel.activemq.config.ActivemqConfig.URI;

@AutoService(SeaTunnelSource.class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review. I have made corresponding modifications

luops added 10 commits February 6, 2025 11:38
# Conflicts:
#	seatunnel-connectors-v2/connector-activemq/src/main/java/org/apache/seatunnel/connectors/seatunnel/activemq/client/ActivemqClient.java
#	seatunnel-connectors-v2/connector-activemq/src/main/java/org/apache/seatunnel/connectors/seatunnel/activemq/config/ActivemqSinkOptions.java
#	seatunnel-connectors-v2/connector-activemq/src/main/java/org/apache/seatunnel/connectors/seatunnel/activemq/sink/ActivemqSinkFactory.java
@@ -27,19 +24,11 @@ Used to write data to Activemq.
| disable_timeStamps_by_default | boolean | no | - |
| use_compression | boolean | no | - |
| always_session_async | boolean | no | - |
| dispatch_async | boolean | no | - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed this? cc @asapekia

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter applies to consumers, not producers


@Override
public void pollNext(Collector output) throws Exception {
consumer.setMessageListener(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this method will block until message consume finished?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asynchronous processing, does not block, triggers a callback when a message arrives.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is async process, the message will lose sometimes. Because the no more element evnet will be send to downstream before some messgae.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Activemq source connector mainly uses the flow mode, which is used for development testing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any better suggestions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break our interface definition. After the pollNext method returns, no data should continue to be generated. I think we should introduce CompletableFuture to let pollNext block until message consume finished. Please refer

Copy link
Contributor Author

@L-Gryps L-Gryps Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add blocking queue, thread pool, CompletableFuture to let pollNext blocking until message consume finished, and concurrent processing. please review.

@L-Gryps
Copy link
Contributor Author

L-Gryps commented Mar 4, 2025

Please review. I added message acknowledge mechanism @Hisoka-X

@@ -36,7 +36,7 @@ public class SeaTunnelEngineLocalExample {

public static void main(String[] args)
throws FileNotFoundException, URISyntaxException, CommandException {
String configurePath = args.length > 0 ? args[0] : "/examples/fake_to_console.conf";
String configurePath = args.length > 0 ? args[0] : "/examples/realtime-sync.conf";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recovered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants