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

Sven Renner updated AMQ-7178:
-----------------------------
    Description: 
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)

  was:
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)


> Table Creation Postgres ActiveMQ
> --------------------------------
>
>                 Key: AMQ-7178
>                 URL: https://issues.apache.org/jira/browse/AMQ-7178
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: activemq-camel, Broker
>            Reporter: Sven Renner
>            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
(v7.6.3#76005)

Reply via email to