Data Tools

You can use the Artemis CLI to execute data maintenance tools:

The following sub-commands are available when running the CLI data command from a particular broker instance that has already been installed using the create command:

NameDescription
printPrints a report about journal records of a non-running server
expExport the message data using a special and independent XML format
impImports the journal to a running broker using the output from expt
encodeshows an internal format of the journal encoded to String
decodeimports the internal journal format from encode
compactCompacts the journal of a non running server
recoverRecover (undelete) messages from an existing journal and create a new one.

You can use the CLI help for more information on how to execute each of the tools. For example:

  1. $ ./artemis help data print
  2. NAME
  3. artemis data print - Print data records information (WARNING: don't use
  4. while a production server is running)
  5. SYNOPSIS
  6. artemis data print [--bindings <binding>] [--broker <brokerConfig>]
  7. [--f] [--jdbc] [--jdbc-bindings-table-name <jdbcBindings>]
  8. [--jdbc-connection-url <jdbcURL>]
  9. [--jdbc-driver-class-name <jdbcClassName>]
  10. [--jdbc-large-message-table-name <jdbcLargeMessages>]
  11. [--jdbc-message-table-name <jdbcMessages>]
  12. [--jdbc-node-manager-table-name <jdbcNodeManager>]
  13. [--jdbc-page-store-table-name <jdbcPageStore>] [--journal <journal>]
  14. [--large-messages <largeMessges>] [--output <output>]
  15. [--paging <paging>] [--reclaimed] [--safe] [--verbose] [--]
  16. [<configuration>]
  17. OPTIONS
  18. --bindings <binding>
  19. The folder used for bindings (default from broker.xml)
  20. --broker <brokerConfig>
  21. This would override the broker configuration from the bootstrap
  22. --f
  23. This will allow certain tools like print-data to be performed
  24. ignoring any running servers. WARNING: Changing data concurrently
  25. with a running broker may damage your data. Be careful with this
  26. option.
  27. --jdbc
  28. It will activate jdbc
  29. --jdbc-bindings-table-name <jdbcBindings>
  30. Name of the jdbc bindigns table
  31. --jdbc-connection-url <jdbcURL>
  32. The connection used for the database
  33. --jdbc-driver-class-name <jdbcClassName>
  34. JDBC driver classname
  35. --jdbc-large-message-table-name <jdbcLargeMessages>
  36. Name of the large messages table
  37. --jdbc-message-table-name <jdbcMessages>
  38. Name of the jdbc messages table
  39. --jdbc-node-manager-table-name <jdbcNodeManager>
  40. Name of the jdbc node manager table
  41. --jdbc-page-store-table-name <jdbcPageStore>
  42. Name of the page store messages table
  43. --journal <journal>
  44. The folder used for messages journal (default from broker.xml)
  45. --large-messages <largeMessges>
  46. The folder used for large-messages (default from broker.xml)
  47. --output <output>
  48. Output name for the file
  49. --paging <paging>
  50. The folder used for paging (default from broker.xml)
  51. --reclaimed
  52. This option will try to print as many records as possible from
  53. reclaimed files
  54. --safe
  55. It will print your data structure without showing your data
  56. --verbose
  57. Adds more information on the execution
  58. --
  59. This option can be used to separate command-line options from the
  60. list of argument, (useful when arguments might be mistaken for
  61. command-line options
  62. <configuration>
  63. Broker Configuration URI, default
  64. 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'

For a full list of data tools commands available use:

  1. $ ./artemis help data
  2. NAME
  3. artemis data - data tools group
  4. (print|imp|exp|encode|decode|compact|recover) (example ./artemis data
  5. print)
  6. SYNOPSIS
  7. artemis data
  8. artemis data compact [--journal <journal>]
  9. [--large-messages <largeMessges>] [--paging <paging>]
  10. [--broker <brokerConfig>] [--bindings <binding>] [--verbose]
  11. artemis data decode [--journal <journal>]
  12. [--large-messages <largeMessges>] [--file-size <size>]
  13. [--paging <paging>] [--prefix <prefix>] [--suffix <suffix>]
  14. [--broker <brokerConfig>] [--directory <directory>]
  15. [--bindings <binding>] [--verbose] --input <input>
  16. artemis data encode [--journal <journal>]
  17. [--large-messages <largeMessges>] [--file-size <size>]
  18. [--paging <paging>] [--prefix <prefix>] [--suffix <suffix>]
  19. [--broker <brokerConfig>] [--bindings <binding>] [--verbose]
  20. [--directory <directory>]
  21. artemis data exp [--jdbc-driver-class-name <jdbcClassName>]
  22. [--journal <journal>] [--jdbc-connection-url <jdbcURL>]
  23. [--large-messages <largeMessges>]
  24. [--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
  25. [--jdbc-large-message-table-name <jdbcLargeMessages>]
  26. [--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
  27. [--bindings <binding>] [--jdbc] [--verbose]
  28. [--jdbc-message-table-name <jdbcMessages>]
  29. [--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
  30. artemis data imp [--legacy-prefixes] [--password <password>]
  31. [--transaction] [--verbose] [--port <port>] [--user <user>] [--sort]
  32. --input <input> [--host <host>]
  33. artemis data print [--reclaimed]
  34. [--jdbc-driver-class-name <jdbcClassName>] [--journal <journal>]
  35. [--jdbc-connection-url <jdbcURL>] [--large-messages <largeMessges>]
  36. [--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
  37. [--jdbc-large-message-table-name <jdbcLargeMessages>] [--safe]
  38. [--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
  39. [--bindings <binding>] [--jdbc] [--verbose]
  40. [--jdbc-message-table-name <jdbcMessages>]
  41. [--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
  42. artemis data recover [--jdbc-driver-class-name <jdbcClassName>]
  43. [--journal <journal>] [--jdbc-connection-url <jdbcURL>]
  44. [--large-messages <largeMessges>] [--reclaimed] --target <outputJournal>
  45. [--jdbc-bindings-table-name <jdbcBindings>] [--paging <paging>] [--f]
  46. [--jdbc-large-message-table-name <jdbcLargeMessages>]
  47. [--broker <brokerConfig>] [--jdbc-page-store-table-name <jdbcPageStore>]
  48. [--bindings <binding>] [--jdbc] [--verbose]
  49. [--jdbc-message-table-name <jdbcMessages>]
  50. [--jdbc-node-manager-table-name <jdbcNodeManager>] [--output <output>]
  51. COMMANDS
  52. With no arguments, Display help information
  53. recover
  54. Recover (undelete) every message on the journal by creating a new
  55. output journal. Rolled backed and acked messages will be sent out to
  56. the output as much as possible.
  57. With --jdbc-driver-class-name option, JDBC driver classname
  58. With --journal option, The folder used for messages journal (default
  59. from broker.xml)
  60. With --jdbc-connection-url option, The connection used for the
  61. database
  62. With --large-messages option, The folder used for large-messages
  63. (default from broker.xml)
  64. With --reclaimed option, This option will try to recover as many
  65. records as possible from reclaimed files
  66. With --target option, Output folder container the new journal with
  67. all the generated messages
  68. With --jdbc-bindings-table-name option, Name of the jdbc bindigns
  69. table
  70. With --paging option, The folder used for paging (default from
  71. broker.xml)
  72. With --f option, This will allow certain tools like print-data to be
  73. performed ignoring any running servers. WARNING: Changing data
  74. concurrently with a running broker may damage your data. Be careful
  75. with this option.
  76. With --jdbc-large-message-table-name option, Name of the large
  77. messages table
  78. With --broker option, This would override the broker configuration
  79. from the bootstrap
  80. With --jdbc-page-store-table-name option, Name of the page store
  81. messages table
  82. With --bindings option, The folder used for bindings (default from
  83. broker.xml)
  84. With --jdbc option, It will activate jdbc
  85. With --verbose option, Adds more information on the execution
  86. With --jdbc-message-table-name option, Name of the jdbc messages
  87. table
  88. With --jdbc-node-manager-table-name option, Name of the jdbc node
  89. manager table
  90. With --output option, Output name for the file
  91. print
  92. Print data records information (WARNING: don't use while a
  93. production server is running)
  94. With --reclaimed option, This option will try to print as many
  95. records as possible from reclaimed files
  96. With --jdbc-driver-class-name option, JDBC driver classname
  97. With --journal option, The folder used for messages journal (default
  98. from broker.xml)
  99. With --jdbc-connection-url option, The connection used for the
  100. database
  101. With --large-messages option, The folder used for large-messages
  102. (default from broker.xml)
  103. With --jdbc-bindings-table-name option, Name of the jdbc bindigns
  104. table
  105. With --paging option, The folder used for paging (default from
  106. broker.xml)
  107. With --f option, This will allow certain tools like print-data to be
  108. performed ignoring any running servers. WARNING: Changing data
  109. concurrently with a running broker may damage your data. Be careful
  110. with this option.
  111. With --jdbc-large-message-table-name option, Name of the large
  112. messages table
  113. With --safe option, It will print your data structure without
  114. showing your data
  115. With --broker option, This would override the broker configuration
  116. from the bootstrap
  117. With --jdbc-page-store-table-name option, Name of the page store
  118. messages table
  119. With --bindings option, The folder used for bindings (default from
  120. broker.xml)
  121. With --jdbc option, It will activate jdbc
  122. With --verbose option, Adds more information on the execution
  123. With --jdbc-message-table-name option, Name of the jdbc messages
  124. table
  125. With --jdbc-node-manager-table-name option, Name of the jdbc node
  126. manager table
  127. With --output option, Output name for the file
  128. exp
  129. Export all message-data using an XML that could be interpreted by
  130. any system.
  131. With --jdbc-driver-class-name option, JDBC driver classname
  132. With --journal option, The folder used for messages journal (default
  133. from broker.xml)
  134. With --jdbc-connection-url option, The connection used for the
  135. database
  136. With --large-messages option, The folder used for large-messages
  137. (default from broker.xml)
  138. With --jdbc-bindings-table-name option, Name of the jdbc bindigns
  139. table
  140. With --paging option, The folder used for paging (default from
  141. broker.xml)
  142. With --f option, This will allow certain tools like print-data to be
  143. performed ignoring any running servers. WARNING: Changing data
  144. concurrently with a running broker may damage your data. Be careful
  145. with this option.
  146. With --jdbc-large-message-table-name option, Name of the large
  147. messages table
  148. With --broker option, This would override the broker configuration
  149. from the bootstrap
  150. With --jdbc-page-store-table-name option, Name of the page store
  151. messages table
  152. With --bindings option, The folder used for bindings (default from
  153. broker.xml)
  154. With --jdbc option, It will activate jdbc
  155. With --verbose option, Adds more information on the execution
  156. With --jdbc-message-table-name option, Name of the jdbc messages
  157. table
  158. With --jdbc-node-manager-table-name option, Name of the jdbc node
  159. manager table
  160. With --output option, Output name for the file
  161. imp
  162. Import all message-data using an XML that could be interpreted by
  163. any system.
  164. With --legacy-prefixes option, Do not remove prefixes from legacy
  165. imports
  166. With --password option, User name used to import the data. (default
  167. null)
  168. With --transaction option, If this is set to true you will need a
  169. whole transaction to commit at the end. (default false)
  170. With --verbose option, Adds more information on the execution
  171. With --port option, The port used to import the data (default 61616)
  172. With --user option, User name used to import the data. (default
  173. null)
  174. With --sort option, Sort the messages from the input (used for older
  175. versions that won't sort messages)
  176. With --input option, The input file name (default=exp.dmp)
  177. With --host option, The host used to import the data (default
  178. localhost)
  179. decode
  180. Decode a journal's internal format into a new journal set of files
  181. With --journal option, The folder used for messages journal (default
  182. from broker.xml)
  183. With --large-messages option, The folder used for large-messages
  184. (default from broker.xml)
  185. With --file-size option, The journal size (default 10485760)
  186. With --paging option, The folder used for paging (default from
  187. broker.xml)
  188. With --prefix option, The journal prefix (default activemq-data)
  189. With --suffix option, The journal suffix (default amq)
  190. With --broker option, This would override the broker configuration
  191. from the bootstrap
  192. With --directory option, The journal folder (default journal folder
  193. from broker.xml)
  194. With --bindings option, The folder used for bindings (default from
  195. broker.xml)
  196. With --verbose option, Adds more information on the execution
  197. With --input option, The input file name (default=exp.dmp)
  198. encode
  199. Encode a set of journal files into an internal encoded data format
  200. With --journal option, The folder used for messages journal (default
  201. from broker.xml)
  202. With --large-messages option, The folder used for large-messages
  203. (default from broker.xml)
  204. With --file-size option, The journal size (default 10485760)
  205. With --paging option, The folder used for paging (default from
  206. broker.xml)
  207. With --prefix option, The journal prefix (default activemq-data)
  208. With --suffix option, The journal suffix (default amq)
  209. With --broker option, This would override the broker configuration
  210. from the bootstrap
  211. With --bindings option, The folder used for bindings (default from
  212. broker.xml)
  213. With --verbose option, Adds more information on the execution
  214. With --directory option, The journal folder (default the journal
  215. folder from broker.xml)
  216. compact
  217. Compacts the journal of a non running server
  218. With --journal option, The folder used for messages journal (default
  219. from broker.xml)
  220. With --large-messages option, The folder used for large-messages
  221. (default from broker.xml)
  222. With --paging option, The folder used for paging (default from
  223. broker.xml)
  224. With --broker option, This would override the broker configuration
  225. from the bootstrap
  226. With --bindings option, The folder used for bindings (default from
  227. broker.xml)
  228. With --verbose option, Adds more information on the execution