[ 
https://issues.apache.org/jira/browse/ARTEMIS-2097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650976#comment-16650976
 ] 

ASF GitHub Bot commented on ARTEMIS-2097:
-----------------------------------------

Github user gaohoward commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2371#discussion_r225353155
  
    --- Diff: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
 ---
    @@ -1789,6 +1790,11 @@ public synchronized RoutingStatus doSend(final 
Transaction tx,
     
           AddressInfo art = getAddressAndRoutingType(new 
AddressInfo(msg.getAddressSimpleString(), routingType));
     
    +      if (postOffice.isAddressBlocked(msg.getAddressSimpleString())) {
    --- End diff --
    
    @clebertsuconic reply here.
    I can think of 2 difficulties using credits:
    1. Some clients (like mqtt, stomp) are not supporting flow control so they 
can't be blocked using credits.
    2. producers are not necessarily bound to one address, they can send 
messages to different addresses (for example one producer can send one message 
to address1, and the next one to address2. It it's blocked on address1, the 
next message also be blocked)
    
    If we simply block the sending threads, it will holding up broker threads 
(like you said OME). Besides the producer may have call-timeout exception.
    
    By throwing a proper exception we can let client to handle their producer 
properly without blocking any thing.



> Pause and Block Producers
> -------------------------
>
>                 Key: ARTEMIS-2097
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2097
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 1.5.5
>         Environment: AMQ-1.5.5
>            Reporter: Tyronne Wickramarathne
>            Assignee: Howard Gao
>            Priority: Major
>             Fix For: unscheduled
>
>
> Could it be possible to block all incoming messages without changing the 
> address-full-policy to 'BLOCK'?
> The address full policy can be configured to block incoming messages should 
> the address full policy reaches the configured max-size-bytes attributes.
> However, on certain circumstances it is important to make a JMS destination 
> drain without accepting incoming messages while keeping the 
> address-full-policy at 'PAGE'. For an instance, if a user needs to bring down 
> the broker for maintenance, it is important to allow the user to drain 
> existing messages in the corresponding destination without accepting any new 
> messages.
>  
> Currently the pause() method on a destination pauses message consumers. In a 
> similar fashion could it be possible to add a new method to block message 
> producers on a given destination irrespective of the address-full-policy 
> being used?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to