Class XmlDataImporter

  • All Implemented Interfaces:
    Action

    @Command(name="imp",
             description="Import all message-data using an XML that could be interpreted by any system.")
    public final class XmlDataImporter
    extends ActionAbstract
    Read XML output from org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataExporter, create a core session, and send the messages to a running instance of ActiveMQ Artemis. It uses the StAX javax.xml.stream.XMLStreamReader for speed and simplicity.
    • Field Detail

      • port

        public int port
      • transactional

        public boolean transactional
      • password

        public String password
      • sort

        public boolean sort
      • legacyPrefixes

        public boolean legacyPrefixes
    • Constructor Detail

      • XmlDataImporter

        public XmlDataImporter()
    • Method Detail

      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • getUser

        public String getUser()
      • setUser

        public void setUser​(String user)
      • process

        public void process​(InputStream inputStream,
                            ClientSession session)
                     throws Exception
        This is the normal constructor for programmatic access to the org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataImporter if the session passed in uses auto-commit for sends.
        If the session needs to be transactional then use the constructor which takes 2 sessions.
        Parameters:
        inputStream - the stream from which to read the XML for import
        session - used for sending messages, must use auto-commit for sends
        Throws:
        Exception
      • process

        public void process​(InputStream inputStream,
                            ClientSession session,
                            ClientSession managementSession)
                     throws Exception
        This is the constructor to use if you wish to import all messages transactionally.
        Pass in a session which doesn't use auto-commit for sends, and one that does (for management operations necessary during import).
        Parameters:
        inputStream - the stream from which to read the XML for import
        session - used for sending messages, doesn't need to auto-commit sends
        managementSession - used for management queries, must use auto-commit for sends
        Throws:
        Exception