Examples of JMSMessageBoxService


Examples of org.wso2.carbon.messagebox.internal.qpid.JMSMessageBoxService

    }*/

    public void sendMessages(String queueName, int numberOfMessages, long visibilityTimeout)
            throws MessageBoxException {

        MessageBoxService messageBoxService = new JMSMessageBoxService();
        // create SQSMessage box
        messageBoxService.createMessageBox(queueName, visibilityTimeout);

        // send messages
        SQSMessage SQSMessage = new SQSMessage();
        for (int i = 0; i < numberOfMessages; i++) {
            SQSMessage.setBody("my SQSMessage " + i);
            SQSMessage.setMd5ofMessageBody("md5ofmessage");
            SQSMessage.setMessageId(UUID.randomUUID().toString());
            messageBoxService.putMessage(queueName, SQSMessage);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.internal.qpid.JMSMessageBoxService

    }

    public List<String> receiveMessages(String queueName, int numberOfMessages,
                                        long visibilityTimeout)
            throws MessageBoxException {
        MessageBoxService messageBoxService = new JMSMessageBoxService();
        List<SQSMessage> SQSMessageList = messageBoxService.receiveMessage(queueName, numberOfMessages, visibilityTimeout, null);
        List<String> receiptHandlers = new ArrayList<String>();
        if (SQSMessageList != null) {
            for (SQSMessage SQSMessageReceived : SQSMessageList) {
                System.out.println("message received ==> " + SQSMessageReceived.getBody() +
                                   " with receipt handler " + SQSMessageReceived.getReceiptHandle());
View Full Code Here

Examples of org.wso2.carbon.messagebox.internal.qpid.JMSMessageBoxService

        return receiptHandlers;
    }

    public void deleteMessages(String queueName, List<String> receiptHandlers)
            throws MessageBoxException {
        MessageBoxService messageBoxService = new JMSMessageBoxService();
        for (String receiptHandler : receiptHandlers) {
            messageBoxService.deleteMessage(queueName, receiptHandler);
            System.out.println("trying to delete message with receipt handler ==> " + receiptHandler);

        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.internal.qpid.JMSMessageBoxService

    }

    public void changeVisibilityTimeout(String queueName, List<String> receiptHandlers,
                                        long visibilityTimeout)
            throws MessageBoxException {
        MessageBoxService messageBoxService = new JMSMessageBoxService();
        for (String receiptHandler : receiptHandlers) {
            messageBoxService.changeVisibility(queueName, receiptHandler, visibilityTimeout);
            System.out.println("default visibility changed with receipt handler ==> " +
                               receiptHandler + " to value " + visibilityTimeout);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.internal.qpid.JMSMessageBoxService

                               receiptHandler + " to value " + visibilityTimeout);
        }
    }

    public void deleteMessageBox(String queueName) throws MessageBoxException {
        MessageBoxService messageBoxService = new JMSMessageBoxService();
        messageBoxService.deleteMessageBox(queueName);
    }
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.