@@ -904,33 +904,6 @@ void RemoteQueue::postMessage(const bmqp::PutHeader& putHeaderIn,
904
904
translation.applyTo (&putHeader);
905
905
906
906
// Relay the PUT message via clusterProxy/cluster
907
- if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY (!bmqt::QueueFlagsUtil::isWriter (
908
- source->handleParameters ().flags ()))) {
909
- BSLS_PERFORMANCEHINT_UNLIKELY_HINT;
910
-
911
- // Either queue was not opened in the WRITE mode (which should have
912
- // been caught in the SDK) or client is posting a message after closing
913
- // or reconfiguring the queue (which may not be caught in the SDK).
914
-
915
- if (d_throttledFailedPutMessages.requestPermission ()) {
916
- BALL_LOG_WARN
917
- << " [THROTTLED] #CLIENT_IMPROPER_BEHAVIOR "
918
- << " Failed PUT message for queue [" << d_state_p->uri ()
919
- << " ] from client [" << source->client ()->description ()
920
- << " ]. Queue not opened in WRITE mode by the client." ;
921
- }
922
-
923
- // Note that a NACK is not sent in this case. This is a case of client
924
- // violating the contract, by attempting to post a message after
925
- // closing/reconfiguring the queue. Since this is out of contract, its
926
- // ok not to send the NACK. If it is still desired to send a NACK, it
927
- // will need some enqueuing b/w client and queue dispatcher threads to
928
- // ensure that despite NACKs being sent, closeQueue response is still
929
- // the last event to be sent to the client for the given queue.
930
-
931
- return ; // RETURN
932
- }
933
-
934
907
SubStreamContext& ctx = d_producerState;
935
908
936
909
if (ctx.d_state == SubStreamContext::e_NONE) {
@@ -944,6 +917,31 @@ void RemoteQueue::postMessage(const bmqp::PutHeader& putHeaderIn,
944
917
945
918
if (ctx.d_state == SubStreamContext::e_CLOSED) {
946
919
isInvalid = true ;
920
+
921
+ if (d_throttledFailedPutMessages.requestPermission ()) {
922
+ BALL_LOG_WARN << " [THROTTLED] Failed PUT message for queue ["
923
+ << d_state_p->uri ()
924
+ << " ]. Upstream is already closed." ;
925
+ }
926
+ }
927
+ else if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY (
928
+ !bmqt::QueueFlagsUtil::isWriter (
929
+ source->handleParameters ().flags ()))) {
930
+ BSLS_PERFORMANCEHINT_UNLIKELY_HINT;
931
+
932
+ // Either queue was not opened in the WRITE mode (which should have
933
+ // been caught in the SDK) or client is posting a message after closing
934
+ // or reconfiguring the queue (which may not be caught in the SDK).
935
+
936
+ isInvalid = true ;
937
+
938
+ if (d_throttledFailedPutMessages.requestPermission ()) {
939
+ BALL_LOG_WARN
940
+ << " [THROTTLED] #CLIENT_IMPROPER_BEHAVIOR "
941
+ << " Failed PUT message for queue [" << d_state_p->uri ()
942
+ << " ] from client [" << source->client ()->description ()
943
+ << " ]. Queue not opened in WRITE mode by the client." ;
944
+ }
947
945
}
948
946
else if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY (
949
947
d_pendingMessages.find (putHeader.messageGUID ()) !=
0 commit comments