Each message your producer publishes has to have the persistent flag set, otherwise the (non-persistent) message will be stored in the memory store. Are you setting that flag when you publish your messages?
On Jun 5, 2017 1:11 AM, "Bill Chen" <billc...@iii.org.tw> wrote: > Hi All, > > I am using ActiveMQ 5.14.5 as MQTT broker, and I would like to use postgres > as database. > > My configuration in activemq.xml: > > <persistenceAdapter> > <jdbcPersistenceAdapter dataDirectory="${activemq.base}/data" > dataSource="#postgres-ds> > <adapter><postgresql-jdbc-adapter/></adapter> > </jdbcPersistenceAdapter> > </persistenceAdapter> > > <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource" > destroy-method="close"> > <property name="serverName" value="192.168.15.2"/> > <property name="databaseName" value="activemq"/> > <property name="portNumber" value="5432"/> > <property name="user" value="activemq"/> > <property name="password" value="activemq"/> > <property name="dataSourceName" value="postgres"/> > <property name="initialConnections" value="1"/> > <property name="maxConnections" value="10"/> > </bean> > > When I start ActiveMQ, I check the tables(activemq_acks, activemq_lock, > activemq_msgs) has created in postgres. > But, no data persist to table after I publish message to subscriber. > > Any hints would be appreciated. > > Regards, > > Bill > > > > -- > View this message in context: http://activemq.2283324.n4. > nabble.com/JDBC-persistence-for-postgresql-tp4727004.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >