Package org.jboss.soa.esb.services.persistence

Examples of org.jboss.soa.esb.services.persistence.RedeliverStore


    private volatile boolean isDone;
   
  public void run ()
  {
        try {
        RedeliverStore store = MessageStoreFactory.getInstance().getRedeliverStore();
        Map<URI, Message> messages = store.getAllMessages("RDLVR");
            for (URI uid : messages.keySet()) {
                if (store.redeliver(uid)) {
                    count++;
                }
            }
            setDone(true);
        } catch (MessageStoreException e) {
View Full Code Here


     */
    @Test
  public void redeliverOne() throws Exception
  {
        log.info("** redeliverOne");
        RedeliverStore store = MessageStoreFactory.getInstance().getRedeliverStore();
        assertEquals((store != null), true);
    //first lets create an undeliverable message
        Service service = new Service("cat", "service");
        URI uid = createMessages(1, service, store);
   
        store.redeliver(uid);
        Message message = store.getMessage(uid);
        //the message should no longer be in the store.
        assertNull(message);
  }
View Full Code Here

     */
    @Test
    public void redeliverOneUnreachable() throws Exception
    {
        log.info("** redeliverOneUnreachable");
        RedeliverStore store = MessageStoreFactory.getInstance().getRedeliverStore();
        assertEquals((store != null), true);
        //first lets create an undeliverable message
        Service service = new Service("cat", "unreachable_service");
        URI uid = createMessages(1, service, store);
       
        int maxRedeliveryCount = store.getMaxRedeliverCount();
        for (int i=0; i<maxRedeliveryCount; i++) {
            store.redeliver(uid);
            Message message = store.getMessage(uid);
            //the message should have a redeliveryCount of i+1
            assertNotNull(message);
            Integer deliverCount = (Integer) message.getProperties().getProperty(RedeliverStore.DELIVER_COUNT);
            assertEquals(deliverCount, i+1);
        }
        //Now redelivering one more time should put it in the DLQ
        store.redeliver(uid);
        Message message = store.getMessage(uid, MessageStore.CLASSIFICATION_DLQ);
        assertNotNull(message);
        message = store.getMessage(uid, MessageStore.CLASSIFICATION_RDLVR);
        assertNull(message);
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.persistence.RedeliverStore

Copyright © 2018 www.massapicom. 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.