[JBoss Messaging] - Re: Scheduled messages not delayed
by jpansier
Indeed, I have look the unit test org.jboss.test.messaging.jms.ScheduledDeliveryTest.
my code :
| @Stateless
| @Clustered(partition="MyPartition")
| @RemoteBinding(jndiBinding="JMSManagerBean/remote")
| @TransactionManagement(value=TransactionManagementType.BEAN)
| public class JMSManagerBean implements JMSManager {
|
| private static final long serialVersionUID = 1L;
|
| private static Logger log = Logger.getLogger(JMSManagerBean.class);
|
| private QueueConnectionFactory qcf;
| private QueueConnection qc = null;
| private QueueSession session = null;
| private QueueSender qs = null;
| private Queue queue;
|
| private int connect() {
| String nomFileOut = "queue/myQueue";
|
| Hashtable<String, String> properties = new Hashtable<String,String>();
| properties.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| properties.put(InitialContext.PROVIDER_URL, "localhost:"+HAJNDI_PORT.intValue());
| Context ictx = new InitialContext(properties);
|
| qcf = (QueueConnectionFactory) ictx.lookup("ClusteredConnectionFactory");
| log.debug("Queue Out Name : " + nomFileOut);
|
| queue = (Queue) ictx.lookup(nomFileOut);
|
| qc = qcf.createQueueConnection();
| session = qc.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
| qs = session.createSender(queue);
|
| return 0;
| }
|
|
| public int sendMessage() {
| try {
| connect();
| TextMessage messageOut;
| messageOut = session.createTextMessage();
|
| messageOut.setText("My message");
| messageOut.setJMSType(String.class.getName());
| try {
| long dateSchedule = current.getDeliveryDate().getTime();
| log.debug("*********** dateSchedule : " + dateSchedule);
| messageOut.setLongProperty(JBossMessage.JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME, dateSchedule);
| } catch (Exception e) {
| log.error("Problem with Schedule Property ",e);
| }
| messageOut.setLongProperty("JMS_JBOSS_REDELIVERY_DELAY", 10000);
| messageOut.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 3);
|
| qs.send(messageOut);
|
| log.debug("SYSTEM.CURRENTTIMEMILLIS : " + System.currentTimeMillis());
| session.commit();
|
| } catch (Exception e) {
| log.error(getClass().getName()+" unable to send message on queue.",e);
| retour = ErrorManager.CAN_NOT_SEND_MT;
| } finally {
| disconnect();
| }
| return 0;
| }
|
|
| private int disconnect() {
| if (qs != null) {
| try {
| qs.close();
| session.close();
| qc.close();
| queue = null;
| qcf = null;
| } catch (Exception e) {
| log.error("",e);
| logNetcool.error("KO");
| }
| }
| return 0;
| }
| }
|
|
Also, I tried with the AUTO_ACKNOWLEDGE mode, but the result is the same.
Thanks,
joel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055530#4055530
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055530
18Â years, 10Â months
[JBoss AOP] - Re: Maven 2 plugin?
by stalep
thanks, my pleasure :)
i can only agree with you that the maven respositories could easily be much better, but i believe its getting there. jboss have its own repository, a snapshot repository and think that modules will be updated faster in the future.
remember that many projects (jboss aop included), still use ant as a build/test-tool and will probably do so for a long time (maven isnt best at everything :).
i enjoy the power and simplicity of ant in small projects where you need a lot of "out-of-the-box" tweaking, but on bigger projects i really like the modularity that maven gives.
personally i believe that most of the jboss projects have good documentation and examples included, but if there is something you feel is missing from the aop documentation let us know and we'll try to make it better. - and yes, the maven plugin will get some documentation and examples when its final :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055526#4055526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055526
18Â years, 10Â months
[JBoss Seam] - Re: Ajax4jsf UnboundedFifoBuffer
by baz
We are migrating one of our projects to jboss 4.2.0GA.
After identifying that we also have to copy commons-digester*.jar and commons-beanutils*.jar to WEB-INF/lib folder
there are no more errors at startup.
But we get the org.apache.commons.collections.UnboundedFifoBuffer
error:-(
We have replaced the commons-collection.jar in jboss*/server/default/lib with one of the versions comming from seam-gen(seam1.2.1GA)
And we are also copying commons-beanutils (in this case version 1.7)
Situation:
1.) Having a project generated with seam-gen(from Seam1.2.1GA) running on JBoss AS 4.0.5GA without complains
2.) Using the instructions on this site: [url]http://www.michaelyuan.com/blog/2007/05/29/seam-book-examples-updated...
[/url]
we tried to migrate to JBoss AS 4.2.0GA
3.) Making the changes corresponding to beanutils and digester
4.) Server starts fine and we are getting the UnboundedFifoBuffer error
5.) Googeling about this error finding among other posts this thread.
6.) trying to copy the right versions of collection and digester.jars
7.) Stuck.. No solution so i post here.
Can one post me a link to working versions of the librarys.
We do have
seam-1.2.1GA
richfaces-1.1.1 with corresponding Ajax
facelets 1.0.13 alpha
commons-collections3.1 (from generated app)
commons-digester1.6
commons-beanutils-1.7.0
Hope someone can help me out.
Ciao,
baz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055525#4055525
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055525
18Â years, 10Â months