New to JMS and websphere scheduling.....
I've set up my Spring JMS much like how Mark did in this tutorial.
http://www.springframework.org/node/527
And I've also set up the websphere schedulerCode:<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="tcp://localhost:61616" /> <bean id="emailQueue" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg value="queue.email" /> </bean> <bean id="emailInvokeSender" class="com.abc.def.jms.EmailSender" p:jmsTemplate-ref="jmsTemplate" /> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" p:connectionFactory-ref="jmsConnectionFactory" p:defaultDestination-ref="emailQueue" /> <bean id="emailListener" class=" org.springframework.jms.listener.adapter.MessageListenerAdapter" p:delegate-ref="emailNotificationService" p:defaultListenerMethod="sendNotificationEmails" /> <bean class="org.springframework.jms.listener.SimpleMessageListenerContainer" p:destination-ref="emailQueue" p:connectionFactory-ref="jmsConnectionFactory" p:messageListener-ref="emailListener" />
(configured scheduler - create db for scheduler)
I've also written the task that sends a JMS message as specified in the IBM infocenter..... but I think I'm missing the tying link between the scheduler and the actual message sending.
The result is the following:Code:Scheduler scheduler = (Scheduler) new InitialContext().lookup("sched/ABCScheduler"); MessageTaskInfo taskInfo = (MessageTaskInfo) scheduler.createTaskInfo(MessageTaskInfo.class); Date startDate = new java.util.Date(System.currentTimeMillis()+30000); taskInfo.setConnectionFactoryJndiName("jms/ActiveMQConnectionFactory"); taskInfo.setDestinationJndiName("queue.email"); taskInfo.setStartTime(startDate); TaskStatus ts = scheduler.create(taskInfo); System.out.println("Task created with id: " + ts.getTaskId()); String taskId = ts.getTaskId();
I can definatly send a message from a test class using the jmsTemplate... but how do we do this with WebSphere scheduler.Code:[8/8/08 14:59:21:398 MDT] 0000002b SystemOut O Task created with id: 104 [8/8/08 14:59:51:318 MDT] 00000026 AlarmListener E SCHD0063E: A task with ID 104 failed to run on Scheduler keyeraScheduler (sched/KeyeraScheduler) because of an exception: javax.naming.NameNotFoundException: Context: abcNode04Cell/nodes/abcNode04/servers/server1, name: queue.email: First component in name queue.email not found..
Note: I would love to use Quartz, but I'm not allowed to.
Any help is appreciated.
Thanks!


Reply With Quote