Examples of DeadLetterStrategy


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

          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

        Message message=node.getMessage();
        if(message!=null){
            // 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
            DeadLetterStrategy deadLetterStrategy=node.getRegionDestination().getDeadLetterStrategy();
            ActiveMQDestination deadLetterDestination=deadLetterStrategy.getDeadLetterQueueFor(message.getDestination());
            BrokerSupport.resend(context, message, deadLetterDestination);

        }
    }
View Full Code Here

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

        brokerService = new BrokerService();

        connectionUri = brokerService.addConnector("tcp://localhost:0").getPublishableConnectString();

        // Configure Dead Letter Strategy
        DeadLetterStrategy strategy = new IndividualDeadLetterStrategy();
        ((IndividualDeadLetterStrategy)strategy).setUseQueueForQueueMessages(true);
        ((IndividualDeadLetterStrategy)strategy).setQueuePrefix("DLQ.");
        strategy.setProcessNonPersistent(false);
        strategy.setProcessExpired(false);

        // Add policy and individual DLQ strategy
        PolicyEntry policy = new PolicyEntry();
        policy.setTimeBeforeDispatchStarts(3000);
        policy.setDeadLetterStrategy(strategy);
View Full Code Here

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

    try{
      if(node!=null){
        Message message=node.getMessage();
        stampAsExpired(message);
        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();
                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 = 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

        broker.setUseJmx(true);
        broker.setPlugins(new BrokerPlugin[] {tsbp});
        connectionUri = broker.addConnector("tcp://localhost:0").getPublishableConnectString();

        // Configure Dead Letter Strategy
        DeadLetterStrategy strategy = new IndividualDeadLetterStrategy();
        strategy.setProcessExpired(true);
        ((IndividualDeadLetterStrategy)strategy).setUseQueueForQueueMessages(true);
        ((IndividualDeadLetterStrategy)strategy).setQueuePrefix("DLQ.");
        strategy.setProcessNonPersistent(true);

        // Add policy and individual DLQ strategy
        PolicyEntry policy = new PolicyEntry();
        policy.setTimeBeforeDispatchStarts(3000);
        policy.setDeadLetterStrategy(strategy);
View Full Code Here

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

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

        PolicyEntry policy = new PolicyEntry();
        DeadLetterStrategy strategy = new DiscardingDeadLetterStrategy();
        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

        brokerService = new BrokerService();

        connectionUri = brokerService.addConnector("tcp://localhost:0").getPublishableConnectString();

        // Configure Dead Letter Strategy
        DeadLetterStrategy strategy = new IndividualDeadLetterStrategy();
        ((IndividualDeadLetterStrategy)strategy).setUseQueueForQueueMessages(true);
        ((IndividualDeadLetterStrategy)strategy).setQueuePrefix("DLQ.");
        strategy.setProcessNonPersistent(false);
        strategy.setProcessExpired(false);

        // Add policy and individual DLQ strategy
        PolicyEntry policy = new PolicyEntry();
        policy.setTimeBeforeDispatchStarts(3000);
        policy.setDeadLetterStrategy(strategy);
View Full Code Here

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

    @Override
    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
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.