Skip to content

Commit bc6b8af

Browse files
committed
Replace rule with expression and polish the OMSBuiltinKeys
1 parent 711ab25 commit bc6b8af

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed
-116 Bytes
Loading

openmessaging-api-samples/src/main/java/io/openmessaging/samples/routing/RoutingApp.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void main(String[] args) throws OMSResourceNotExistException {
4848
KeyValue routingAttr = OMS.newKeyValue();
4949
routingAttr.put(OMSBuiltinKeys.ROUTING_SOURCE, sourceQueue)
5050
.put(OMSBuiltinKeys.ROUTING_DESTINATION, destinationQueue)
51-
.put(OMSBuiltinKeys.ROUTING_RULE, "color = 'red'");
51+
.put(OMSBuiltinKeys.ROUTING_EXPRESSION, "color = 'red'");
5252

5353
resourceManager.createRouting("HELLO_ROUTING", routingAttr);
5454

openmessaging-api/src/main/java/io/openmessaging/OMSBuiltinKeys.java

+52-2
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,72 @@
1818
package io.openmessaging;
1919

2020
/**
21-
* This is the centralized source for keys that are used by {@link KeyValue}.
21+
* This is the centralized source for keys that are used for OMS standard attributes.
2222
*
2323
* @version OMS 1.0.0
2424
* @since OMS 1.0.0
2525
*/
2626
public interface OMSBuiltinKeys {
27+
/**
28+
* The {@code DRIVER_IMPL} key represents the vendor implementation
29+
* entry of {@link MessagingAccessPoint}.
30+
*/
2731
String DRIVER_IMPL = "DRIVER_IMPL";
32+
33+
/**
34+
* The {@code ACCESS_POINTS} key shows the specified access points in OMS driver schema.
35+
* @see <a href="https://github.com/openmessaging/specification/blob/master/oms_access_point_schema.md">Access Point Schema</a>
36+
*/
2837
String ACCESS_POINTS = "ACCESS_POINTS";
38+
39+
/**
40+
* The {@code NAMESPACE} key defines the isolated space of resources and related operations.
41+
*/
2942
String NAMESPACE = "NAMESPACE";
43+
44+
/**
45+
* The {@code ACCOUNT_ID} key shows the specified account info in OMS driver schema.
46+
*/
3047
String ACCOUNT_ID = "ACCOUNT_ID";
48+
49+
/**
50+
* The {@code REGION} key shows the specified region in OMS driver schema.
51+
*/
3152
String REGION = "REGION";
53+
54+
/**
55+
* The {@code PRODUCER_ID} key represents the the unique producer id of a producer instance.
56+
*/
3257
String PRODUCER_ID = "PRODUCER_ID";
58+
59+
/**
60+
* The {@code CONSUMER_ID} key represents the the unique consumer id of a consumer instance.
61+
*/
3362
String CONSUMER_ID = "CONSUMER_ID";
63+
64+
/**
65+
* The {@code OPERATION_TIMEOUT} key defines the timeout of almost all the method calls in OMS.
66+
*/
3467
String OPERATION_TIMEOUT = "OPERATION_TIMEOUT";
3568

69+
/**
70+
* The {@code ROUTING_SOURCE} key shows the source queue of a {@code Routing} instance.
71+
* <p>
72+
* The {@code Routing} consists of a triple, include source queue, destination queue and expression.
73+
*/
3674
String ROUTING_SOURCE = "ROUTING_SOURCE";
75+
76+
/**
77+
* The {@code ROUTING_DESTINATION} key shows the destination queue of a {@code Routing} instance.
78+
* <p>
79+
* The {@code Routing} consists of a triple, include source queue, destination queue and expression.
80+
*/
3781
String ROUTING_DESTINATION = "ROUTING_DESTINATION";
38-
String ROUTING_RULE = "ROUTING_RULE";
82+
83+
/**
84+
* The {@code ROUTING_EXPRESSION} key shows the expression of a {@code Routing} instance.
85+
* <p>
86+
* The {@code Routing} consists of a triple, include source queue, destination queue and expression.
87+
*/
88+
String ROUTING_EXPRESSION = "ROUTING_EXPRESSION";
3989
}

0 commit comments

Comments
 (0)