Tuesday, 3 November 2015

AMQ_SCHEDULED_DELAY not working correctly


AMQ_SCHEDULED_DELAY not working correctly


After the below method implemenation , I am able to send the message to the ActiveMQ queue. But, the delay period is not working correctly.

Here I have the mentioned the delay period as 60000 ms (i.e. 1 mins).


public void sendMessage(final String xmlMessage) {
        try {
            jmsTemplate.send("Your_Queue_Name", new MessageCreator() {
                public Message createMessage(final Session session)
                    throws JMSException {
                    Message message = session.createTextMessage(xmlMessage);
                    message.setLongProperty(
                        ScheduledMessage.AMQ_SCHEDULED_DELAY,
                        60000));
                    return message;
                }
            });
        } catch (Exception e) {
            //"Error occured :: Sending to queue failed "
        }
    }

The message is throwing immidiatly via onMessage(). It means the message is not taking the  ScheduledMessage.AMQ_SCHEDULED_DELAY for my specified message.
After subsequent analysis and investigation , I found we need to configure the schedulerSupport="true" in broker.



Add schedulerSupport="true" in the broker config file (/conf/activemq.xml).

Sample :-
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" schedulerSupport="true">

Hope it will help you.



Monday, 2 November 2015

What is Sonar?

What is Sonar or SonarQube ?



SonarQube is an open platform to manage code quality. Basically its at platform or tool by using we can improve the code quality and code coverage. You can find how to configure sonar on your local machine here.

Donwload the sonar jars .


More info Sonar.




Hope it will help you. Happy and quality development.


Follow for more details on Google+ and @Facebook!!!



See More  -