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

Implemented RabbitMQ source connector. #31

Merged
merged 3 commits into from
Jan 15, 2018

Conversation

a-panchenko
Copy link
Contributor

No description provided.

Copy link

@danosipov danosipov left a comment

Choose a reason for hiding this comment

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

Any tests?

String connectionName = config.getString(CONNECTION_NAME);
String queueName = config.getString(QUEUE_NAME);
if (consumer == null) {
throw new IllegalArgumentException("consumeFunction cannot be null.");

Choose a reason for hiding this comment

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

"consumer cannot be null."

Choose a reason for hiding this comment

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

Can this really happen this late in the initialization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this can happen when a user of the connectors framework creates RabbitMQSourceConnector object, doesn't invoke setConsumer method and invokes open method. Probably, it'd make sense to create only one constructor for RabbitMQSourceConnector such as:

public RabbitMQSourceConnector(Consumer<Collection<byte[]>> consumeFunction) {
//...
}

Choose a reason for hiding this comment

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

I see - I think an example usecase would be helpful to see it in action.

rabbitMQChannel.queueDeclare(queueName, false, false, false, null);
com.rabbitmq.client.Consumer consumer = new RabbitMQConsumer(this.consumer, rabbitMQChannel);
rabbitMQChannel.basicConsume(queueName, consumer);

Choose a reason for hiding this comment

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

Log line that connection has been opened with some details might be helpful for debugging any issues that come up.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@a-panchenko
Copy link
Contributor Author

@danosipov

Any tests?

Well, there seems to be nothing to test with unit tests. As for integration test, I think they should be added along with final distributed implementation. Correct me if I'm mistaken.

@aahmed-se
Copy link
Collaborator

This looks to be fine for me any concerns before we merge it , tests can be discussed later

@aahmed-se
Copy link
Collaborator

am merging this for now

@aahmed-se aahmed-se closed this Jan 15, 2018
@aahmed-se aahmed-se reopened this Jan 15, 2018
@aahmed-se aahmed-se merged commit 94a9bbb into openconnectors:master Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants