Je viens de refaire un test basé sur ActiveMQ dont je n'ai pas modifié la conf après installation (je suis sur les paramètres par défaut).
Avec ce code simplifié :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/**
*
*/
package com.citizenweb.utilz;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.apache.activemq.Message;
import org.apache.activemq.broker.region.Destination;
/**
* @author Fred
*
*/
public class Run2 {
/**
* @param args
* @throws NamingException
* @throws JMSException
*/
public static void main(String[] args) throws NamingException, JMSException {
Context context = null;
ConnectionFactory factory = null;
Session session = null;
Connection connection = null;
Destination dest = null;
MessageProducer sender = null;
MessageConsumer receiver = null;
Message message = null;
String factoryName = "ConnectionFactory";
String destName = null;
Hashtable<String,String> properties = new Hashtable<String,String>();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
properties.put(Context.PROVIDER_URL, "vm://localhost:61616");
properties.put(Context.SECURITY_PRINCIPAL, "admin");
properties.put(Context.SECURITY_CREDENTIALS, "admin");
context = new InitialContext(properties);
factory = (ConnectionFactory) context.lookup(factoryName);
connection = (Connection) factory.createConnection();
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
connection.start();
session.createTopic("TATA");
session.commit();
session.close();
connection.close();
context.close();
}
} |
Suite à la précédente question de Gugelhupg, j'ai positionné le paramètre "transaction" à "true" :
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
Même soucis.
Voici ce que j'imprime dans la console :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[C:\Users\Fred\git\NewRezoSoss\RezoSoss\activemq-data\localhost\KahaDB]
INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO | KahaDB is version 6
INFO | Recovering from the journal @1:2884
INFO | Recovery replayed 1 operations from the journal in 0.012 seconds.
INFO | PListStore:[C:\Users\Fred\git\NewRezoSoss\RezoSoss\activemq-data\localhost\tmp_storage] started
INFO | Apache ActiveMQ 5.13.3 (localhost, ID:NASTYBOY-54111-1468239658100-0:1) is starting
INFO | Apache ActiveMQ 5.13.3 (localhost, ID:NASTYBOY-54111-1468239658100-0:1) started
INFO | For help or more information please see: http://activemq.apache.org
WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: C:\Users\Fred\git\NewRezoSoss\RezoSoss\activemq-data\localhost\KahaDB only has 16496 mb of usable space. - resetting to maximum available disk space: 16496 mb
WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: C:\Users\Fred\git\NewRezoSoss\RezoSoss\activemq-data\localhost only has 16496 mb of usable space. - resetting to maximum available disk space: 16496 mb
INFO | Connector vm://localhost started
INFO | Connector vm://localhost stopped
INFO | Apache ActiveMQ 5.13.3 (localhost, ID:NASTYBOY-54111-1468239658100-0:1) is shutting down
INFO | PListStore:[C:\Users\Fred\git\NewRezoSoss\RezoSoss\activemq-data\localhost\tmp_storage] stopped
INFO | Stopping async queue tasks
INFO | Stopping async topic tasks
INFO | Stopped KahaDB
INFO | Apache ActiveMQ 5.13.3 (localhost, ID:NASTYBOY-54111-1468239658100-0:1) uptime 0.730 seconds
INFO | Apache ActiveMQ 5.13.3 (localhost, ID:NASTYBOY-54111-1468239658100-0:1) is shutdown |
Pas d'erreur catchée, il semble faire son travail, mais rien n'est créé dans la console ActiveMQ.
Partager