[ 
https://issues.apache.org/jira/browse/AMQ-7178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Baptiste Onofré resolved AMQ-7178.
---------------------------------------
    Fix Version/s:     (was: 5.15.12)
                       (was: 5.16.0)
       Resolution: Cannot Reproduce

I used your {{activemq.xml}} and the three tables are successfully created in 
PostgreSQL (running on Docker).

Can you please some details in order to try to reproduce ?

> Table Creation Postgres ActiveMQ
> --------------------------------
>
>                 Key: AMQ-7178
>                 URL: https://issues.apache.org/jira/browse/AMQ-7178
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Camel
>            Reporter: Sven Renner
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> I tried running my ActiveMQ / Postgres Setup on Openshift but keep having 
> errors in my Postgres SQL. 
>  
> activemq.xml:
> {code:java}
> <persistenceAdapter >
>  <jdbcPersistenceAdapter dataSource="#postgres-ds" lockKeepAlivePeriod="5000">
>  <statements>
>  <statements messageTableName = "activemq_msgs" durableSubAcksTableName = 
> "activemq_acks" lockTableName = "activemq_lock"/>
>  </statements>
>  <locker>
>  <lease-database-locker lockAcquireSleepInterval="10000"/>
>  </locker>
>  </jdbcPersistenceAdapter>
>  </persistenceAdapter>{code}
> {code:java}
> <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
>         <property name="url" value="jdbc:postgresql://postgres-ingn-db/db"/>
>         <property name="user" value="xxx"/>
>         <property name="password" value="xxx"/>
>         <property name="initialConnections" value="1"/>
>         <property name="maxConnections" value="10"/>
>     </bean>
> {code}
> ERROR:  relation "activemq_msgs" already exists
> STATEMENT:  CREATE TABLE activemq_msgs(ID BIGINT NOT NULL, CONTAINER 
> VARCHAR(250) NOT NULL, MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION 
> BIGINT, MSG BYTEA, PRIMARY KEY ( ID ) )
> ERROR:  relation "activemq_msgs_midx" already exists
> STATEMENT:  CREATE INDEX activemq_msgs_MIDX ON activemq_msgs 
> (MSGID_PROD,MSGID_SEQ)
> I tried some stuff from https://issues.apache.org/jira/browse/AMQ-3189 but 
> couldn't get it work.
> Thanks in advance
> Edit:
> Once if change the config to:
> {code:java}
> <persistenceAdapter >
>             <jdbcPersistenceAdapter dataSource="#postgres-ds" 
> lockKeepAlivePeriod="5000" useDatabaseLock="false">
>                 <statements>
>                     <statements tablePrefix="ingn_" messageTableName = 
> "activemq_msgs" durableSubAcksTableName = "activemq_acks" lockTableName = 
> "activemq_lock"/>
>                 </statements>
>                 <locker>
>                     <lease-database-locker lockAcquireSleepInterval="10000"/>
>                 </locker>
>             </jdbcPersistenceAdapter>
>         </persistenceAdapter>
> {code}
> Now the only errors i get are:
> 2019-04-10 09:23:57.394 CEST [32] ERROR:  constraint "activemq_acks_pkey" of 
> relation "ingn_activemq_acks" does not exist
> 2019-04-10 09:23:57.394 CEST [32] STATEMENT:  ALTER TABLE ingn_activemq_acks 
> DROP CONSTRAINT "activemq_acks_pkey"
> 2019-04-10 09:23:57.402 CEST [32] ERROR:  multiple primary keys for table 
> "ingn_activemq_acks" are not allowed
> 2019-04-10 09:23:57.402 CEST [32] STATEMENT:  ALTER TABLE ingn_activemq_acks 
> ADD PRIMARY KEY (CONTAINER, CLIENT_ID, SUB_NAME, PRIORITY)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to