2 Replies Latest reply on Jun 26, 2017 4:34 PM by Martyn Taylor

    AMQ7 and JDBC(mysql)

    Anatoly Ershov Newbie

      Good afternoon!

      I'm trying to connect amq7 to mysql.

      My configuration:

      cat /tmp/broker.xml

       

      <configuration xmlns="urn:activemq"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

         <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:schemaLocation="urn:activemq:core ">

            <name>delmy</name>

            <persistence-enabled>true</persistence-enabled>

            <!-- this could be ASYNCIO or NIO

             -->

            <journal-type>JDBC</journal-type>

            <paging-directory>./data/paging</paging-directory>

            <bindings-directory>./data/bindings</bindings-directory>

            <journal-directory>./data/journal</journal-directory>

            <large-messages-directory>./data/large-messages</large-messages-directory>

            <journal-datasync>true</journal-datasync>

            <journal-min-files>2</journal-min-files>

            <journal-pool-files>-1</journal-pool-files>

            <journal-buffer-timeout>360000</journal-buffer-timeout>

            <disk-scan-period>5000</disk-scan-period>

            <max-disk-usage>90</max-disk-usage>

            <global-max-size>100Mb</global-max-size>

            <acceptors>

               <acceptor name="artemis">tcp://0.0.0.0:61617?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>

               <acceptor name="amqp">tcp://0.0.0.0:5673?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300</acceptor>

               <acceptor name="stomp">tcp://0.0.0.0:61614?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>

               <acceptor name="hornetq">tcp://0.0.0.0:5446?protocols=HORNETQ,STOMP;useEpoll=true</acceptor>

               <acceptor name="mqtt">tcp://0.0.0.0:1884?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>

            </acceptors>

            <security-settings>

               <security-setting match="#">

                  <permission type="createNonDurableQueue" roles="amq"/>

                  <permission type="deleteNonDurableQueue" roles="amq"/>

                  <permission type="createDurableQueue" roles="amq"/>

                  <permission type="deleteDurableQueue" roles="amq"/>

                  <permission type="createAddress" roles="amq"/>

                  <permission type="deleteAddress" roles="amq"/>

                  <permission type="consume" roles="amq"/>

                  <permission type="browse" roles="amq"/>

                  <permission type="send" roles="amq"/>

                  <!-- we need this otherwise ./artemis data imp wouldn't work -->

                  <permission type="manage" roles="amq"/>

               </security-setting>

            </security-settings>

            <address-settings>

               <!-- if you define auto-create on certain queues, management has to be auto-create -->

               <address-setting match="activemq.management#">

                  <dead-letter-address>DLQ</dead-letter-address>

                  <expiry-address>ExpiryQueue</expiry-address>

                  <redelivery-delay>0</redelivery-delay>

                  <!-- with -1 only the global-max-size is in use for limiting -->

                  <max-size-bytes>-1</max-size-bytes>

                  <message-counter-history-day-limit>10</message-counter-history-day-limit>

                  <address-full-policy>PAGE</address-full-policy>

                  <auto-create-queues>true</auto-create-queues>

                  <auto-create-addresses>true</auto-create-addresses>

                  <auto-create-jms-queues>true</auto-create-jms-queues>

                  <auto-create-jms-topics>true</auto-create-jms-topics>

               </address-setting>

               <!--default for catch all-->

               <address-setting match="#">

                  <dead-letter-address>DLQ</dead-letter-address>

                  <expiry-address>ExpiryQueue</expiry-address>

                  <redelivery-delay>0</redelivery-delay>

                  <!-- with -1 only the global-max-size is in use for limiting -->

                  <max-size-bytes>-1</max-size-bytes>

                  <message-counter-history-day-limit>10</message-counter-history-day-limit>

                  <address-full-policy>PAGE</address-full-policy>

                  <auto-create-queues>true</auto-create-queues>

                  <auto-create-addresses>true</auto-create-addresses>

                  <auto-create-jms-queues>true</auto-create-jms-queues>

                  <auto-create-jms-topics>true</auto-create-jms-topics>

               </address-setting>

            </address-settings>

            <addresses>

               <address name="DLQ">

                  <anycast>

                     <queue name="DLQ" />

                  </anycast>

               </address>

               <address name="ExpiryQueue">

                  <anycast>

                     <queue name="ExpiryQueue" />

                  </anycast>

               </address>

              <address name="delmy">

                  <anycast>

                     <queue name="delmy-q" />

                  </anycast>

                      <multicast>

                     <queue name="delmy-t"/>

                  </multicast>

               </address>

            </addresses>

         </core>

            <store>

               <database-store>

                  <jdbc-connection-url>jdbc:mysql://activemq:activemq@broker0.test:3306/activemq</jdbc-connection-url>

                  <bindings-table-name>BINDINGS_TABLE</bindings-table-name>

                  <message-table-name>MESSAGE_TABLE</message-table-name>

                  <large-message-table-name>LARGE_MESSAGES_TABLE</large-message-table-name>

                  <jdbc-driver-class-name>com.mysql.jdbc.Driver</jdbc-driver-class-name>

               </database-store>

            </store>

      </configuration>

       

      But I'm getting the error:

       

      OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

      19:34:19,025 ERROR [org.apache.activemq.artemis.core.client] AMQ214019: Invalid configuration: org.xml.sax.SAXParseException; cvc-enumeration-valid: Value 'JDBC' is not facet-valid with respect to enumeration '[ASYNCIO, NIO, MAPPED]'. It must be a value from the enumeration.

              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3145) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3055) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2134) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:853) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.finishNode(DOMValidatorHelper.java:342) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:247) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190) [rt.jar:1.8.0_131]

              at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109) [rt.jar:1.8.0_131]

              at javax.xml.validation.Validator.validate(Validator.java:124) [rt.jar:1.8.0_131]

              at org.apache.activemq.artemis.utils.XMLUtil.validate(XMLUtil.java:330) [artemis-core-client-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:85) [artemis-server-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.cli.commands.Configurable.getFileConfiguration(Configurable.java:93) [artemis-cli-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:64) [artemis-cli-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:148) [artemis-cli-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:95) [artemis-cli-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:122) [artemis-cli-2.0.0.amq-700005-redhat-1.jar:2.0.0.amq-700005-redhat-1]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_131]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_131]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131]

              at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131]

              at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129) [artemis-boot.jar:2.0.0.amq-700005-redhat-1]

              at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49) [artemis-boot.jar:2.0.0.amq-700005-redhat-1]

       

      Please, help!