Examples of DeadLetterStrategy


Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

    try{
      boolean sent=false;
      if(node!=null){
        Message message=node.getMessage();
        if(message!=null&&node.getRegionDestination()!=null){
          DeadLetterStrategy deadLetterStrategy=node
                  .getRegionDestination().getDeadLetterStrategy();
          if(deadLetterStrategy!=null){
            if(deadLetterStrategy.isSendToDeadLetterQueue(message)){
              long expiration=message.getExpiration();
              message.setExpiration(0);
              message.setProperty("originalExpiration",new Long(
                      expiration));
              if(!message.isPersistent()){
                message.setPersistent(true);
                message.setProperty("originalDeliveryMode",
                        "NON_PERSISTENT");
              }
              // The original destination and transaction id do
              // not get filled when the message is first
              // sent,
              // it is only populated if the message is routed to
              // another destination like the DLQ
              ActiveMQDestination deadLetterDestination=deadLetterStrategy
                      .getDeadLetterQueueFor(message
                              .getDestination());
              if (context.getBroker()==null) {
                context.setBroker(getRoot());
              }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

          MessageReference node){
    try{
      if(node!=null){
        Message message=node.getMessage();
        if(message!=null && node.getRegionDestination()!=null){
          DeadLetterStrategy deadLetterStrategy=node
                  .getRegionDestination().getDeadLetterStrategy();
          if(deadLetterStrategy!=null){
            if(deadLetterStrategy.isSendToDeadLetterQueue(message)){
                // message may be inflight to other subscriptions so do not modify
                message = message.copy();
                stampAsExpired(message);
                message.setExpiration(0);
                if(!message.isPersistent()){
                  message.setPersistent(true);
                  message.setProperty("originalDeliveryMode",
                        "NON_PERSISTENT");
              }
              // The original destination and transaction id do
              // not get filled when the message is first sent,
              // it is only populated if the message is routed to
              // another destination like the DLQ
              ActiveMQDestination deadLetterDestination=deadLetterStrategy
                      .getDeadLetterQueueFor(message
                              .getDestination());
              if (context.getBroker()==null) {
                context.setBroker(getRoot());
              }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = super.createBroker();

        PolicyEntry policy = new PolicyEntry();
        DeadLetterStrategy strategy = new IndividualDeadLetterStrategy();
        strategy.setProcessNonPersistent(true);
        policy.setDeadLetterStrategy(strategy);

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);
        PolicyEntry policy = new PolicyEntry();
        DeadLetterStrategy defaultDeadLetterStrategy = policy.getDeadLetterStrategy();
        if(defaultDeadLetterStrategy!=null) {
            defaultDeadLetterStrategy.setProcessNonPersistent(true);
        }
        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);
        return broker;
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

          MessageReference node){
    try{
      if(node!=null){
        Message message=node.getMessage();
        if(message!=null&&node.getRegionDestination()!=null){
          DeadLetterStrategy deadLetterStrategy=node
                  .getRegionDestination().getDeadLetterStrategy();
          if(deadLetterStrategy!=null){
            if(deadLetterStrategy.isSendToDeadLetterQueue(message)){
              long expiration=message.getExpiration();
              message.setExpiration(0);
              message.setProperty("originalExpiration",new Long(
                      expiration));
              if(!message.isPersistent()){
                message.setPersistent(true);
                message.setProperty("originalDeliveryMode",
                        "NON_PERSISTENT");
              }
              // The original destination and transaction id do
              // not get filled when the message is first
              // sent,
              // it is only populated if the message is routed to
              // another destination like the DLQ
              ActiveMQDestination deadLetterDestination=deadLetterStrategy
                      .getDeadLetterQueueFor(message
                              .getDestination());
              if (context.getBroker()==null) {
                context.setBroker(getRoot());
              }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

            MessageReference node, Subscription subscription){
        try{
            if(node!=null){
                Message message=node.getMessage();
                if(message!=null && node.getRegionDestination()!=null){
                    DeadLetterStrategy deadLetterStrategy=node
                            .getRegionDestination().getDeadLetterStrategy();
                    if(deadLetterStrategy!=null){
                        if(deadLetterStrategy.isSendToDeadLetterQueue(message)){
                            // message may be inflight to other subscriptions so do not modify
                            message = message.copy();
                            stampAsExpired(message);
                            message.setExpiration(0);
                            if(!message.isPersistent()){
                                message.setPersistent(true);
                                message.setProperty("originalDeliveryMode",
                                        "NON_PERSISTENT");
                            }
                            // The original destination and transaction id do
                            // not get filled when the message is first sent,
                            // it is only populated if the message is routed to
                            // another destination like the DLQ
                            ActiveMQDestination deadLetterDestination=deadLetterStrategy
                                    .getDeadLetterQueueFor(message, subscription);
                            if (context.getBroker()==null) {
                                context.setBroker(getRoot());
                            }
                            BrokerSupport.resendNoCopy(context,message,
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

        }
        super.send(producerExchange, message);
    }

    private boolean isDestinationDLQ(Message message) {
        DeadLetterStrategy deadLetterStrategy;
        Message tmp;

        if (message != null && message.getRegionDestination() != null) {
            deadLetterStrategy = message.getRegionDestination().getDeadLetterStrategy();
            if (deadLetterStrategy != null) {
                // Cheap copy, since we only need two fields
                tmp = new ActiveMQMessage();
                tmp.setDestination(message.getOriginalDestination());
                tmp.setRegionDestination(message.getRegionDestination());

                // Determine if we are headed for a DLQ
                ActiveMQDestination deadLetterDestination = deadLetterStrategy.getDeadLetterQueueFor(tmp, null);
                if (deadLetterDestination.equals(message.getDestination())) {
                    return true;
                }
            }
        }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);
        PolicyEntry policy = new PolicyEntry();
        policy.setEnableAudit(false);
        DeadLetterStrategy defaultDeadLetterStrategy = policy.getDeadLetterStrategy();
        if(defaultDeadLetterStrategy!=null) {
            defaultDeadLetterStrategy.setProcessNonPersistent(true);
            ((AbstractDeadLetterStrategy) defaultDeadLetterStrategy).setEnableAudit(false);
        }
        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

          MessageReference node, Subscription subscription){
    try{
      if(node!=null){
        Message message=node.getMessage();
        if(message!=null && node.getRegionDestination()!=null){
          DeadLetterStrategy deadLetterStrategy=node
                  .getRegionDestination().getDeadLetterStrategy();
          if(deadLetterStrategy!=null){
            if(deadLetterStrategy.isSendToDeadLetterQueue(message)){
                // message may be inflight to other subscriptions so do not modify
                message = message.copy();
                stampAsExpired(message);
                message.setExpiration(0);
                if(!message.isPersistent()){
                  message.setPersistent(true);
                  message.setProperty("originalDeliveryMode",
                        "NON_PERSISTENT");
              }
              // The original destination and transaction id do
              // not get filled when the message is first sent,
              // it is only populated if the message is routed to
              // another destination like the DLQ
              ActiveMQDestination deadLetterDestination=deadLetterStrategy
                      .getDeadLetterQueueFor(message, subscription);
              if (context.getBroker()==null) {
                context.setBroker(getRoot());
              }
              BrokerSupport.resendNoCopy(context,message,
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.DeadLetterStrategy

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);
        PolicyEntry policy = new PolicyEntry();
        DeadLetterStrategy defaultDeadLetterStrategy = policy.getDeadLetterStrategy();
        if(defaultDeadLetterStrategy!=null) {
            defaultDeadLetterStrategy.setProcessNonPersistent(true);
        }
        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);
        return broker;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.