一.Apache Artemis介绍
Apache Artemis是apache的一个新的消息系统, 这个消息系统是来源于 redhat的 “异步消息系统 HornetQ”
HornetQ的相关资料有如下:
http://wenku.baidu.com/view/2f19b1557fd5360cba1adbd9.html?from=search
1. 关于Apache Artemis
http://activemq.apache.org/artemis/ 项目的注意
http://activemq.apache.org/artemis/download.html 下载页面
另外 可以参考 HornetQ的相关资料, 目前同 HornetQ还有很大的相似性
选择他的Artemis的考虑是, 他是中等成熟的 消息系统, 功能够用, 代码少, 阅读方便, 便于理解, 这样有了问题才好 进行相关的处理工作。
而 activemq 代码太庞大了, 功能太多, 想彻底弄清楚要费非常大力气
而apache Apollo 是基于acitvemq的基础上, 做了内核调整, 因此不确定代码情况, 以及成熟稳定情况, 可以后续再研究
2. Apache activemq, apache Apollo, apache Artemis 以及 apache kafka的区别
如下面文章
http://stackoverflow.com/questions/27666943/activemq-vs-apollo-vs-kafka
36 down vote accepted | Apache ActiveMQ is a great workhorse full of features and nice stuff. It's not the fastest MQ software around but fast enough for most use cases. Among features are flexible clustring, fail-over, integrations with different application servers, security etc. Apache Apollo is an attempt to write a new core for ActiveMQ to cope with a large amount of clients and messages. It does not have all nice and convenient feature of ActiveMQ but scales a lot better. Apache Apollo is a really fast MQ implementation when you give it a large multi-core server and thousands of concurrent connections. It has a nice, simple UI, but is not a "one-size-fits-all" solution. It seems that there is an attempt ongoing to merge a number of ActiveMQ features with HornetQ under the name ActiveMQ Artemis. HornetQ has JMS2.0 support, so my humble guess is that it's likely to appear in ActiveMQ 6.x. Kafka is a different beast. It's a very simple message broker intended to scale persistent publish subscribe (topics) as fast as possible over multiple servers. For small-medium sized deployments, Kafka is probably not the best option. It also has it's way to do things to achieve the high throughput, so you have to trade a lot in terms of flexibility to get high distributed throughput. If you are new to the area of MQ and brokers, I guess Kafka is overkill. On the other hand - if you have a decent sized server cluster and wonder how to push as many messages as possible through it - give Kafka a spin!
| ||||||||||||||||
|
二.Apache Artemis 安装
1. 下载Apache Artemis
http://activemq.apache.org/artemis/ 项目的注意
http://activemq.apache.org/artemis/download.html 下载页面
2. 解压缩
下载后, 解压缩到目录中, 要确保没有目录名称没有空格
解压缩下载好的 windows下的zip文件
3. 打开解压缩目录中的文档 参照文档进行相关操作
Getting Started
Note (Windows users): The broker currently does not support spaces in path names. For this reason the broker should be placed in a directory with no spaces in it's absolute path.
对于windows用户目前这个消息系统不支持在路径上有空格, 因此必须使用没有空格的绝对路径
Note (Windows users): Examples below use the shell script `artemis` for use with linux, Windows users should use the `artemis.cmd` script with the same parameters.
对于本文中要使用的`artemis`命了 在windows下要使用`artemis.cmd`
4. 创建服务器Creating a broker
To create a broker, navigate to the distribution 'bin/' directory and run:
为了创建消息服务器, 请进入到安装目录的bin目录下, 然后输入下面命令
$ ./artemis create $directory
Where $directory is the folder that you'd like the broker to be created. The create process will input for any required property not specified.
这个$directory文件夹是你想把broker创建的目录, 创建过程会要求你输入一些必要的没有指定的系统属性
Example:
--user: is mandatory with this configuration:
Please provide the default username:
admin
例如, --user, 是必须的, 请提供一个默认的用户名
--password: is mandatory with this configuration:
Please provide the default password:
--password 是必须的配置, 请输入默认密码
--allow-anonymous: is mandatory with this configuration:
Allow anonymous access? (Y/N):
y
--allow-anonymous 是必须的, 用来指定是否允许匿名用户存取消息系统。
For a full list of available options for the create process you may use: $ ./artemis help create 查看详细的帮助列表
NAME
artemis create - creates a new broker instance
SYNOPSIS
artemis create [--allow-anonymous]
[--cluster-password <clusterPassword>] [--cluster-user <clusterUser>]
[--clustered] [--data <data>] [--encoding <encoding>] [--force]
[--home <home>] [--host <host>] [--java-options <javaOptions>]
[--password <password>] [--port-offset <portOffset>] [--replicated]
[--role <role>] [--shared-store] [--silent] [--user <user>] [--]
<directory>
...
You can now start the broker by executing:
"D:\mq\broker1\bin\artemis" run
Or you can setup the broker as Windows service and run it in the background:
"D:\mq\broker1\bin\artemis-service.exe" install
"D:\mq\broker1\bin\artemis-service.exe" start
To stop the windows service:
"D:\mq\broker1\bin\artemis-service.exe" stop
To uninstall the windows service
"D:\mq\broker1\bin\artemis-service.exe" uninstall
5. 进入应用程序目录
在bin中是程序运行的必要文件
Etc目录是各种配置
Data存储数据
Log日志
6. 启动应用程序
Starting the Broker
Once the broker has been created, use the artemis (or artemis.cmd on windows) script found under the bin directory of the newly created broker to manage the life cycle of the broker. To run the Apache ActiveMQ Artemis broker with the default configuration, run the command shown below from the "bin" directory of the created broker.
新的broker服务器被创建完成后, 就可用新创建的broker目录下的bin目录中的artemis.cmd 命令(linux下artemis) 来启动或者管理broker的各项工作
$ ./artemis run 用默认配置启动服务器
To specify a broker configuration file:
$ ./artemis run --config scheme:location 指定一个配置文件进行启动
e.g.
$ ./artemis run --config xml:/home/artemis/bootstrap.xml
It is possible to configure run time paramters in the artemis.conf (artemis.conf.bat for windows) file under the "bin" directory of the broker directory.
7. 停止服务器
Stopping the Broker
To stop the broker please use the artemis script from the broker's bin directory:
$ ./artemis stop