0

I have some non-critical clean up operation that I want to perform inside my web-app. I'm hoping to hand it off to an asynchronous process, but I don't have any JMS provider available to me ( and I'm not likely to get one approved in the timescales ).

I like the idea of the Spring MDP, but all the examples that I have seen explicitly tie it in to a JMS implementation of some sort. Is it possible to tie it to a Queue implementation based on the java.util.Queue interface? I'm thinking that I could just push messages on to a queue and use a Spring MDP to process them.

Am I barking up the wrong tree?

asked Jun 17, 2013 at 11:43

3 Answers 3

2

Maybe you could use asynchronous tasks to do the clean up. You could have a CleanUpcomponent that offers @Asnyc annotated methods. The TaskExecutors implicitly use a Queue for pending tasks (like plain Java's ExecutorService). There would also be the option to collect submitted clean up requests in a Queue and let them be processed by a scheduled task.

Another alternative may be Guava's EventBus. Setting one up wth spring should be straight forward and there is an AsynchronousEventBus available.

answered Jun 17, 2013 at 12:09
1
  • Thanks Pyranja - that's exactly what I wanted Commented Jun 17, 2013 at 13:26
0

You can use RabbitMQ or ActiveMQ with Spring.

answered Jun 17, 2013 at 12:06
0

You can embed an ApacheMQ BrokerService in your application

<bean id="broker" class="org.apache.activemq.broker.BrokerService" init-method="start">
 <property name="transportConnectorURIs">
 <list>
 <value>tcp://localhost:61616</value>
 </list>
 </property>
</bean>

Now you can use it just as a regular ApacheMQ.

answered Jun 17, 2013 at 13:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.