File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
openmessaging/src/main/java/io/openmessaging/rocketmq/consumer Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,13 @@ public PullConsumerImpl(final KeyValue properties) {
60
60
61
61
this .rocketmqPullConsumer = pullConsumerScheduleService .getDefaultMQPullConsumer ();
62
62
63
- String accessPoints = clientConfig .getAccessPoints ();
64
- if (accessPoints == null || accessPoints .isEmpty ()) {
65
- throw new OMSRuntimeException ("-1" , "OMS AccessPoints is null or empty." );
63
+ if ("true" .equalsIgnoreCase (System .getenv ("OMS_RMQ_DIRECT_NAME_SRV" ))) {
64
+ String accessPoints = clientConfig .getAccessPoints ();
65
+ if (accessPoints == null || accessPoints .isEmpty ()) {
66
+ throw new OMSRuntimeException ("-1" , "OMS AccessPoints is null or empty." );
67
+ }
68
+ this .rocketmqPullConsumer .setNamesrvAddr (accessPoints .replace (',' , ';' ));
66
69
}
67
- this .rocketmqPullConsumer .setNamesrvAddr (accessPoints .replace (',' , ';' ));
68
70
69
71
this .rocketmqPullConsumer .setConsumerGroup (consumerGroup );
70
72
Original file line number Diff line number Diff line change @@ -52,11 +52,13 @@ public PushConsumerImpl(final KeyValue properties) {
52
52
this .properties = properties ;
53
53
this .clientConfig = BeanUtils .populate (properties , ClientConfig .class );
54
54
55
- String accessPoints = clientConfig .getAccessPoints ();
56
- if (accessPoints == null || accessPoints .isEmpty ()) {
57
- throw new OMSRuntimeException ("-1" , "OMS AccessPoints is null or empty." );
55
+ if ("true" .equalsIgnoreCase (System .getenv ("OMS_RMQ_DIRECT_NAME_SRV" ))) {
56
+ String accessPoints = clientConfig .getAccessPoints ();
57
+ if (accessPoints == null || accessPoints .isEmpty ()) {
58
+ throw new OMSRuntimeException ("-1" , "OMS AccessPoints is null or empty." );
59
+ }
60
+ this .rocketmqPushConsumer .setNamesrvAddr (accessPoints .replace (',' , ';' ));
58
61
}
59
- this .rocketmqPushConsumer .setNamesrvAddr (accessPoints .replace (',' , ';' ));
60
62
61
63
String consumerGroup = clientConfig .getConsumerId ();
62
64
if (null == consumerGroup || consumerGroup .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments