@@ -41,6 +41,7 @@ register() ->
41
41
{policy_validator , <<" expires" >>},
42
42
{policy_validator , <<" max-length" >>},
43
43
{policy_validator , <<" max-length-bytes" >>},
44
+ {policy_validator , <<" max-priority" >>},
44
45
{policy_validator , <<" queue-mode" >>},
45
46
{policy_validator , <<" overflow" >>},
46
47
{operator_policy_validator , <<" expires" >>},
@@ -100,6 +101,12 @@ validate_policy0(<<"max-length-bytes">>, Value)
100
101
validate_policy0 (<<" max-length-bytes" >>, Value ) ->
101
102
{error , " ~p is not a valid maximum length in bytes" , [Value ]};
102
103
104
+ validate_policy0 (<<" max-priority" >>, Value )
105
+ when is_integer (Value ), Value >= 0 , Value =< 255 ->
106
+ ok ;
107
+ validate_policy0 (<<" max-priority" >>, Value ) ->
108
+ {error , " ~p is not a valid max priority (must be an integer in the 1-255 range)" , [Value ]};
109
+
103
110
validate_policy0 (<<" queue-mode" >>, <<" default" >>) ->
104
111
ok ;
105
112
validate_policy0 (<<" queue-mode" >>, <<" lazy" >>) ->
@@ -117,4 +124,3 @@ merge_policy_value(<<"message-ttl">>, Val, OpVal) -> min(Val, OpVal);
117
124
merge_policy_value (<<" max-length" >>, Val , OpVal ) -> min (Val , OpVal );
118
125
merge_policy_value (<<" max-length-bytes" >>, Val , OpVal ) -> min (Val , OpVal );
119
126
merge_policy_value (<<" expires" >>, Val , OpVal ) -> min (Val , OpVal ).
120
-
0 commit comments