Skip to content

[ISSUE #1199] Implement the 1.0.0 openmessaging new consumer API for rocketmq oms module#1240

Merged
zongtanghu merged 8 commits intoapache:feature_oms_1.0.0from
odbozhou:feature_oms_1.0.0
Jun 20, 2019
Merged

[ISSUE #1199] Implement the 1.0.0 openmessaging new consumer API for rocketmq oms module#1240
zongtanghu merged 8 commits intoapache:feature_oms_1.0.0from
odbozhou:feature_oms_1.0.0

Conversation

@odbozhou
Copy link
Contributor

@odbozhou odbozhou commented Jun 2, 2019

What is the purpose of the change

#1199 Implement the 1.0.0 openmessaging new consumer API for rocketmq oms module

Brief changelog

1、Adapt to the new consumer api
2、Adjust consumer example
3、Optimize consumer code implementation
4、Fix bug

Verifying this change

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@zongtanghu
Copy link
Contributor

Hi @odbozhou do you verify this pr in your local enviroment?

@odbozhou
Copy link
Contributor Author

Hi @odbozhou do you verify this pr in your local enviroment?

Yes,Sending and consuming messages have been validated

public void run() {
consumer.shutdown();
messagingAccessPoint.shutdown();
consumer.stop();
Copy link
Member

Choose a reason for hiding this comment

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

Could you make a clarify why remove messagingAccessPoint lifecyle management in the new API,just for simplicity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are startup and shutdown methods in oms-java-0.3.1 alpha MessagingAccessPoint, but there is no content in old rocketmq-open messaging implementation. In openmessaging-java-1.0.0, the MessagingAccessPoint lifecycle API has been removed, not in the new rocketmq-openmessaging implementation.

@Override
public void routing(String sourceQueue, String targetQueue) {
@Override
public ResourceManager resourceManager() {
Copy link
Member

Choose a reason for hiding this comment

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

I could not find the usage of resourceManager in your new code.

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 current PR is too big, and resourceManager will be implemented in the next pr

import io.openmessaging.rocketmq.config.DefaultQueueMetaData;
import io.openmessaging.rocketmq.domain.ConsumeRequest;
import io.openmessaging.rocketmq.domain.NonStandardKeys;
import io.openmessaging.rocketmq.utils.OMSUtil;
Copy link
Member

Choose a reason for hiding this comment

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

It's not a good name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Name has been modified

@vongosling
Copy link
Member

Just quickly look through, it needs more tests to make the code reliable in addition to what I have pointed in code review. But if you could do more followup, I would like to help to review again and again... I think it is a good polish for integration with OpenMessaging.

@vongosling vongosling closed this Jun 13, 2019
@vongosling vongosling reopened this Jun 13, 2019
@odbozhou
Copy link
Contributor Author

Just quickly look through, it needs more tests to make the code reliable in addition to what I have pointed in code review. But if you could do more followup, I would like to help to review again and again... I think it is a good polish for integration with OpenMessaging.

I will add more unit tests and look forward to contributing more to the community

messageExt2 = messageExt;
}
}
assertThat(messageExt1).isNotNull();
Copy link
Contributor

Choose a reason for hiding this comment

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

Here,I think it will be better if you can verify the messageExt's detailed content values by using assertEquals method.For example,you can verify body value,UserProperty and topic,other places you can refer to modify if the same as here. @odbozhou

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 has increased verification

queueMetaData3 = queueMetaData;
}
}
assertThat(queueMetaData1).isNotNull();
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above.

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 has increased verification

message2 = message;
}
}
assertThat(message1).isNotNull();
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above.

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 has increased verification

message2 = message;
}
}
assertThat(message1).isNotNull();
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above,you can adjust codes appropriately!

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 has increased verification

@zongtanghu
Copy link
Contributor

@vongosling @duhenglucky @ShannonDing Please help to review this pr again.Thanks very much.

@zongtanghu
Copy link
Contributor

LGTM

@zongtanghu zongtanghu merged commit 246e34e into apache:feature_oms_1.0.0 Jun 20, 2019
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.

4 participants