You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2014/12/03 08:59:28 UTC
[1/4] activemq-6 git commit: ACTIVEMQ6-49 removing chinese quickstart
doc
Repository: activemq-6
Updated Branches:
refs/heads/master 4e8edab4f -> b61747de0
ACTIVEMQ6-49 removing chinese quickstart doc
https://issues.apache.org/jira/browse/ACTIVEMQ6-49
Some left over from the chinese docs
Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/cb7774cf
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/cb7774cf
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/cb7774cf
Branch: refs/heads/master
Commit: cb7774cfead178174b37a646180fd8513d65cdd9
Parents: 4e8edab
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Dec 2 12:21:46 2014 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Dec 2 12:32:52 2014 -0500
----------------------------------------------------------------------
docs/quickstart-guide/zh/about.xml | 67 ------
docs/quickstart-guide/zh/download.xml | 70 ------
docs/quickstart-guide/zh/examples.xml | 216 -------------------
.../zh/images/hornetQ_logo_600px.png | Bin 23866 -> 0 bytes
docs/quickstart-guide/zh/installation.xml | 158 --------------
docs/quickstart-guide/zh/introduction.xml | 25 ---
docs/quickstart-guide/zh/master.xml | 46 ----
docs/quickstart-guide/zh/notice.xml | 29 ---
docs/quickstart-guide/zh/running.xml | 68 ------
9 files changed, 679 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/about.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/about.xml b/docs/quickstart-guide/zh/about.xml
deleted file mode 100644
index 1022aa1..0000000
--- a/docs/quickstart-guide/zh/about.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-
-<chapter id="about">
- <title>关于ActiveMQ</title>
- <para>什么是ActiveMQ?</para>
- <itemizedlist>
- <listitem>
- <para>ActiveMQ是一个开源项目。它的目标是一个多协议、可嵌入、高性能、可集群的异步的消息系统。</para>
- </listitem>
- <listitem>
- <para>有关ActiveMQ是什么及不是什么的更多的问题,请访问
- <ulink url="http://www.jboss.org/community/wiki/ActiveMQGeneralFAQs">FAQs wiki
- 页</ulink>。</para>
- </listitem>
- </itemizedlist>
- <para>为什么要使用ActiveMQ? 以下给出了几个理由:</para>
- <itemizedlist>
- <listitem>
- <para>ActiveMQ是100%的开源软件。 ActiveMQ 采用 Apache v 2.0开源协议,对用户的限制最小。</para>
- </listitem>
- <listitem>
- <para>ActiveMQ的设计强调可用性。</para>
- </listitem>
- <listitem>
- <para>采用Java语言编写。可以在任何Java 6+ 的平台上运行。这几乎包括了从Windows到IBM mainframes的每个平台。</para>
- </listitem>
- <listitem>
- <para>性能出众。不但对非持久化消息的处理性能达到了非常高的性能。独特高效的日志(journal)使持久消息处理接近非持久消息的性能。</para>
- </listitem>
- <listitem>
- <para>功能全面。不仅拥有其它成熟消息产品所具有的全部功能,而且还有很多独特的功能。</para>
- </listitem>
- <listitem>
- <para>ActiveMQ的设计遵从了简约的原则。对第三方软件的依赖极少。根据不同的需要,
- ActiveMQ可以单独运行,也可以运行于JEE应用服务器中。它还可以嵌入到你自己的应用程序中。</para>
- </listitem>
- <listitem>
- <para>完美的可获得性。ActiveMQ提供自动客户端失效备援(automatic client failover)功能,能保证在服务器故障时没有消息丢失或消息重复。</para>
- </listitem>
- <listitem>
- <para>超级灵活的集群方案。可以控制集群进行消息负载均衡的方式。分布在不同地理位置的各个集群间可以通过非可靠的网络连接形成一个全球网络。
- 还可以非常灵活地配置消息路由。</para>
- </listitem>
- <listitem>
- <para>请访问 <ulink
- url="http://www.jboss.org/community/wiki/ActiveMQFeatures">wiki</ulink>来全面了解ActiveMQ的所有功能介绍。</para>
- </listitem>
- </itemizedlist>
-</chapter>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/download.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/download.xml b/docs/quickstart-guide/zh/download.xml
deleted file mode 100644
index 34ee2f3..0000000
--- a/docs/quickstart-guide/zh/download.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-<chapter id="download">
- <title>下载</title>
- <para>ActiveMQ项目的官方地址是 <ulink url="http://activemq.org/"
- >http://activemq.org/</ulink>。</para>
- <section id="download.software">
- <title>软件下载</title>
- <para>ActiveMQ的下载地址是<ulink
- url="http://activemq.org/downloads.html/"
- >http://activemq.org/downloads.html</ulink></para>
- </section>
- <section id="download.git">
- <title>项目信息</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>ActiveMQ的 <ulink
- url="http://www.jboss.org/community/wiki/ActiveMQ">wiki</ulink></para>
- </listitem>
- <listitem>
- <para>如果在使用ActiveMQ中发生任何问题,可以去我们的 <ulink
- url="http://www.jboss.org/index.html?module=bb&op=viewforum&f=312">用户论坛
- </ulink></para>
- </listitem>
- <listitem>
- <para>如果你有开发方面的问题与想法,请访问我们的 <ulink
- url="http://www.jboss.org/index.html?module=bb&op=viewforum&f=313"
- >开发论坛</ulink></para>
- </listitem>
- <listitem>
- <para>请加入我们的<ulink url="irc://irc.freenode.net:6667/activemq"
- >IRC频道</ulink>与我们的核心开发工程师交流。</para>
- </listitem>
- <listitem>
- <para>我们项目有自己的 <ulink url="http://activemq.blogspot.com/">博客</ulink></para>
- </listitem>
- <listitem>
- <para>还可以跟踪我们的<ulink url="http://twitter.com/activemq">twitter</ulink></para>
- </listitem>
- <listitem>
- <para>ActiveMQ的Git代码库地址 <ulink
- url="https://github.com/activemq/activemq"
- >https://github.com/activemq/activemq</ulink></para>
- </listitem>
- <listitem>
- <para>每次发布的版本标签都在<ulink
- url="https://github.com/activemq/activemq/tags"
- >https://github.com/activemq/activemq/tags</ulink>下能找到。</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
-</chapter>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/examples.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/examples.xml b/docs/quickstart-guide/zh/examples.xml
deleted file mode 100644
index 44be24e..0000000
--- a/docs/quickstart-guide/zh/examples.xml
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-<chapter id="examples">
- <title>运行ActiveMQ例子</title>
- <para>在ActiveMQ的<literal>examples</literal>目录下有两组例子,它们是:</para>
- <itemizedlist>
- <listitem>
- <para>JMS例子 - 这些例子展示的是使用JMS发送与接收消息的功能。</para>
- </listitem>
- <listitem>
- <para>Java EE 例子 - 这些例子展示的是与应用服务器的集成,例如MDB,EJB,Servlet等。</para>
- </listitem>
- </itemizedlist>
- <section id="examples.jms">
- <title>JMS例子</title>
- <para>所有JMS都有统一的格式。每个例子都有自己的目录,它的内容包括:</para>
- <itemizedlist>
- <listitem>
- <para><literal>build.xml</literal></para>
- <para>ant的build文件,用来运行例子。</para>
- </listitem>
- <listitem>
- <para><literal>src</literal> 目录</para>
- <para>例子的代码。</para>
- </listitem>
- <listitem>
- <para><literal>server0</literal>配置目录</para>
- <para>它包含了运行服务器所需要的配置文件。有的集群的例子可能有多个这样的目录,如<literal>server0</literal>,
- <literal>server1</literal>等。</para>
- </listitem>
- </itemizedlist>
- <para>在运行每个例子时,都要先启动一个或多个单独的服务器。当例子运行完毕,再将它们停止。</para>
- <para>做为演示我们这里运行queue例子。其它的例子可以参见用户手册。</para>
- <para>首先打开一个命令行窗口(shell),进入到ActiveMQ的 <literal
- >examples/jms/queue</literal>目录。</para>
- <para>敲入命令<literal>./build.sh</literal> (或者在Windows上<literal>build.bat</literal>),你
- 将看到如下的输出:</para>
- <programlisting>Buildfile: build.xml
-
-run:
-
-init:
-
-compile:
- [echo] src.example.dir=/home/andy/projects/activemq/trunk/examples/jms/queue/src
- [javac] Compiling 5 source files to /home/andy/projects/activemq/trunk/examples/jms/queue
-/build/classes
-
-runExample:
- [java] 10:41:04,149 INFO @main [JMSExample] activemq.example.runServer is true
- [java] 10:41:04,149 INFO @main [JMSExample] starting server with config 'server0'
- logServerOutput true
- [java] 10:41:04,149 INFO @main [JMSExample] and vm args: -Xms512M,-Xmx512M,-XX:+U
-seParallelGC,-XX:+AggressiveOpts,-XX:+UseFastAccessorMethods,-Djava.util.logging.config.
-file=/home/andy/projects/activemq/trunk/examples/jms/common/../../../src/config/stand-alone/no
-n-clustered/logging.properties
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:08,437 INFO @main [Journal
-StorageManager] AIO journal selected
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:08,437 WARN @main [Journal
-StorageManager] AIO wasn't located on this platform, it will fall back to using pure Jav
-a NIO. If your platform is Linux, install LibAIO to enable the AIO journal
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:08,437 WARN @main [Securit
-yStoreImpl] It has been detected that the cluster admin password which is used to replic
-ate management operation from one node to the other has not had its password changed fro
-m the installation default. Please see the ActiveMQ user guide for instructions o
-n how to do this.
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:10,941 INFO @main [ActiveMQCo
-nnectionFactory] read only is false
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:10,941 INFO @main [ActiveMQCo
-nnectionFactory] read only is false
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:10,941 INFO @main [ActiveMQCo
-nnectionFactory] read only is false
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:10,991 WARN @main [JMSServ
-erManagerImpl] Binding for java:/ConnectionFactory already exists
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:10,991 WARN @main [JMSServ
-erManagerImpl] Binding for java:/XAConnectionFactory already exists
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:11,241 INFO @main [Messagi
-ngServerImpl] ActiveMQ Server version 2.0.0.BETA5 (buzz-buzz, 107) started
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:10:41:11,241 INFO @main [ActiveMQBoot
-strapServer] ActiveMQ server started
- [java] org.apache.activemq.jms.example.SpawnedJMSServer out:STARTED::
- [java] 10:41:11,276 INFO @main [JMSExample] using server0/client-jndi.properties f
-or jndi
- [java] Sent message: This is a text message
- [java] Received message: This is a text message
- [java]
- [java] #####################
- [java] ### SUCCESS! ###
- [java] #####################
-
-BUILD SUCCESSFUL
-Total time: 13 seconds
-</programlisting>
- <para>恭喜!你已经成功地运行了你的第一个ActiveMQ例子。试着运行其它的例子。</para>
- </section>
- <section id="examples.messaging">
- <title>Java EE例子</title>
- <para>Java EE的例子需要首先运行一个JEE应用服务器。这些例子包括MDB,Servlet,EJB等等。你首先要安装JBoss应用服务
- 器。参见前面的章节进行安装。</para>
- <para>这里我们将用MDB例子来说明。有关其它例子的详细信息参见用户手册。首先确认JBoss应用服务器已经启动。</para>
- <para>如同其它Java EE例子一样,MDB需要部署到应用服务器。第一,将<literal>JBOSS_HOME</literal>环境变量
- 指向你的应用服务器安装目录。如在Linux下:</para>
- <programlisting>export JBOSS_HOME=/home/jbossas5.1/build/output/jboss-5.1.0.GA</programlisting>
- <para>然后就可以进行部署了。在<literal>examples/javaee/mdb</literal>目录下运行:</para>
- <programlisting>./build.sh deploy</programlisting>
- <para>它将创建一个“messaging"的AS配置,并用它来启动AS服务器。</para>
- <para>在命令行窗口你会看到如下的输出:</para>
- <programlisting>Buildfile: build.xml
-
-validate-jboss:
-
-deploy:
-
-deploy-resources:
- [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
- /server/default-with-activemq/deploy/activemq.sar
- [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
- /server/default-with-activemq/deploy/activemq.sar
-
-init:
-
-compile:
-
-jar:
- [jar] Building jar: /home/andy/projects/activemq/trunk/examples/javaee/mdb/build/mdb-exa
- mple.jar
-
-ear:
- [jar] Building jar: /home/andy/projects/activemq/trunk/examples/javaee/mdb/build/mdb-exa
- mple.ear
-
-deploy-ear:
- [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
-
- .......
-
-
- [exec] 16:01:04,607 INFO [JBossASKernel] Class:javax.jms.MessageListener
- [exec] 16:01:04,607 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=mdb-example.ear,
- jar=mdb-example.jar,name=MessageMDBExample,service=EJB3) to KernelDeployment of:
- mdb-example.jar
- [exec] 16:01:04,702 INFO [EJBContainer] STARTED EJB: org.apache.activemq.javaee.example.server
- .MDBExample ejbName: MessageMDBExample
- [exec] 16:01:09,496 INFO [TomcatDeployment] deploy, ctxPath=/mdb-example
- [exec] 16:01:09,812 WARNING [config] Unable to process deployment descriptor for cont
- ext '/mdb-example'
- [exec] 16:01:09,812 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context
- '/mdb-example'
- [exec] 16:01:09,958 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-
- 8080
- [exec] 16:01:09,990 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
- [exec] 16:01:10,001 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag
- =JBoss_5_1_0_GA date=200905151005)] Started in 6m:21s:797ms
-
-</programlisting>
- <para>现在我们可以运行例子了。在<literal>mdb</literal>目录下运行下列命令:</para>
- <programlisting>./build.sh</programlisting>
- <para>你将看到如下输出:</para>
- <programlisting>Buildfile: build.xml
-
-run:
-
-init:
-
-compile:
-
-runExample:
- [java] Sent message: This is a text message
-
-BUILD SUCCESSFUL
-Total time: 7 seconds</programlisting>
- <para>在JBoss应用服务器端你还会看到如下的输出:</para>
- <programlisting>16:27:54,703 INFO [STDOUT] message This is a text message received</programlisting>
- <para>然后在<literal>mdb</literal>目录下运行下面的命令可以将这个例子卸载。</para>
- <programlisting>./build.sh undeploy</programlisting>
- <para>你将会看到如下的输出:</para>
- <programlisting>Buildfile: build.xml
-
-validate-jboss:
-
-undeploy:
-
-undeploy-misc:
- [delete] Deleting: /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
- /server/default-with-activemq/deploy/mdb-example.ear
- [delete] Deleting: /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
- /server/default-with-activemq/deploy/activemq.sar/activemq-queues.xml
- [delete] Deleting: /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA
- /server/default-with-activemq/deploy/activemq.sar/activemq-jms.xml
-
-BUILD SUCCESSFUL
-Total time: 1 second
-</programlisting>
- <para>你还会在窗口输出中看到MDB的应用最終被删除了,如:</para>
- <programlisting>16:36:45,277 INFO [EJBContainer] STOPPED EJB: org.jboss.javaee.example.server.MDBExample
- ejbName: MessageMDBExample
-</programlisting>
- <para>恭喜!你已经成功地部署并运行了一个Java EE的例子。</para>
- </section>
-</chapter>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/images/hornetQ_logo_600px.png
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/images/hornetQ_logo_600px.png b/docs/quickstart-guide/zh/images/hornetQ_logo_600px.png
deleted file mode 100644
index b71f4ba..0000000
Binary files a/docs/quickstart-guide/zh/images/hornetQ_logo_600px.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/installation.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/installation.xml b/docs/quickstart-guide/zh/installation.xml
deleted file mode 100644
index 7f69620..0000000
--- a/docs/quickstart-guide/zh/installation.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-<chapter id="installation">
- <title>安装</title>
- <para>本章讲述如何安装ActiveMQ。</para>
- <section id="installation.prerequisites">
- <title>准备</title>
- <note>
- <para>ActiveMQ只能在Java 6或以上版本中运行</para>
- </note>
- <para>默认情况下ActiveMQ运行的内存是1GiB。如果你的电脑内存少于1GiB,或者你希望更多的内存给ActiveMQ,你
- 可以修改 <literal>bin/run.sh</literal>脚本文件。</para>
- <para>ActiveMQ有自己的快速日志系统,它能够使用libaio(在Linux上它是默认的)或Java的NIO。
- 如果要使用libaio,你需要首先在你的Linux上安装它。</para>
- <para>如果你不在使用Linux,则不需要考虑这个问题。</para>
- <para>要安装libaio,你可以使用root用户完成以下步骤:</para>
- <para>使用yum(例如在Fedora 或 Red Hat Enterprise Linux上):</para>
- <programlisting>yum install libaio</programlisting>
- <para>使用aptitude, (例如在Ubuntu或Debian系统上):</para>
- <programlisting>apt-get install libaio</programlisting>
- </section>
- <section id="installation.standalone">
- <title>单独的ActiveMQ服务器</title>
- <para>将软件包下载后,将其解压到你选定的目录下。这里你就可以<link linkend="running.standalone">直接运行了</link>。
- 下面给出了它的目录结构: </para>
- <programlisting>
- |___ bin
- |
- |___ config
- | |___ jboss-as-4
- | |___ jboss-as-5
- | |___ stand-alone
- |
- |___ docs
- | |___ api
- | |___ quickstart-guide
- | |___ user-manual
- |
- |___ examples
- | |___ core
- | |___ javaee
- | |___ jms
- |
- |___ lib
- |
- |___ licenses
- |
- |___ schemas
- </programlisting>
- <itemizedlist>
- <listitem>
- <para><literal>bin</literal> -- 运行ActiveMQ的二进制文件和脚本文件。</para>
- </listitem>
- <listitem>
- <para><literal>config</literal> -- ActiveMQ的配置文件。它包括了单独模式或者运行在
- JBoss AS 4 或 5中的配置。请参考配置索引来了解配置有详细信息。</para>
- </listitem>
- <listitem>
- <para><literal>docs</literal> -- ActiveMQ的文档及Javadoc。 </para>
- </listitem>
- <listitem>
- <para><literal>examples</literal> -- JMS and Java EE例子。有关详细信息请参见
- 'running examples'一章。 </para>
- </listitem>
- <listitem>
- <para><literal>lib</literal> -- 运行ActiveMQ所需要的jar文件和库文件 </para>
- </listitem>
- <listitem>
- <para><literal>licenses</literal> -- ActiveMQ的软件协议</para>
- </listitem>
- <listitem>
- <para><literal>schemas</literal> -- ActiveMQ配置文件的XML Schema</para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="installation.jboss.as5">
- <title>ActiveMQ运行于JBoss应用服务器5.x</title>
- <para>ActiveMQ可以部署在<ulink url="http://www.jboss.org/jbossas/">JBoss AS
- 5</ulink>中。目前默认的应用服务器没有安装ActiveMQ(ActiveMQ将是JBoss 6的默认JMS提供者),因此
- 你需要为ActiveMQ创建新的AS 5的配置(profile)。</para>
- <para>创建AS 5新配置的步骤:</para>
- <orderedlist>
- <listitem>
- <para>下载并安装JBoss AS 5</para>
- </listitem>
- <listitem>
- <para>设置环境变量<literal>JBOSS_HOME</literal>指向JBoss AS 5的安装目录。</para>
- </listitem>
- <listitem>
- <para>运行ActiveMQ的<literal>config/jboss-as-5</literal>下的<literal>./build.sh</literal> (或
- 者如果在Windows下运行<literal>build.bat</literal>)。</para>
- </listitem>
- </orderedlist>
- <para>这将会在<literal>$JBOSS_HOME/server</literal>创建两个服务器配置:</para>
- <itemizedlist>
- <listitem>
- <para><literal>default-with-activemq</literal> -- 这个相当于AS 5的<literal
- >default</literal>配置但其JMS提供者替换成为ActiveMQ。在这个配置中的ActiveMQ
- 是<emphasis>非集群</emphasis>的。</para>
- </listitem>
- <listitem>
- <para><literal>all-with-activemq</literal> -- 这个相当于AS 5的<literal
- >all</literal>配置但其JMS提供者替换成为ActiveMQ。这个配置中的ActiveMQ
- 是<emphasis>集群</emphasis>的。</para>
- </listitem>
- </itemizedlist>
- <para>这时,你就可以启动上面其中任何一个配置的JBoss AS 5服务器了,例如:</para>
- <programlisting>$JBOSS_HOME/bin/run.sh -c default-with-activemq</programlisting>
- </section>
- <section id="installation.jboss.as4">
- <title>ActiveMQ运行于JBoss应用服务器4.x</title>
- <para>为了在AS 4中安装ActiveMQ,你需要创建新的配置(profile)。</para>
- <para>步骤如下:</para>
- <orderedlist>
- <listitem>
- <para>下载并安装JBoss AS 4</para>
- </listitem>
- <listitem>
- <para>设置环境变量<literal>JBOSS_HOME</literal>指向JBoss AS 4的安装目录。</para>
- </listitem>
- <listitem>
- <para>运行ActiveMQ的<literal>config/jboss-as-4</literal>下的<literal>./build.sh</literal> (或
- 者如果在Windows下运行<literal>build.bat</literal>)。</para>
- </listitem>
- </orderedlist>
- <para>这将会在<literal>$JBOSS_HOME/server</literal>创建两个服务器配置:</para>
- <itemizedlist>
- <listitem>
- <para><literal>default-with-activemq</literal> -- 这个相当于AS 4的<literal
- >default</literal>配置但其JMS提供者替换成为ActiveMQ。在这个配置中的ActiveMQ
- 是<emphasis>非集群</emphasis>的。</para>
- </listitem>
- <listitem>
- <para><literal>all-with-activemq</literal> -- 这个相当于AS 4的<literal
- >all</literal>配置但其JMS提供者替换成为ActiveMQ。这个配置中的ActiveMQ
- 是<emphasis>集群</emphasis>的。</para>
- </listitem>
- </itemizedlist>
- <para>这时,你就可以启动上面其中任何一个配置的JBoss AS 4服务器了,例如:</para>
- <programlisting>$JBOSS_HOME/bin/run.sh -c default-with-activemq</programlisting>
- </section>
-</chapter>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/introduction.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/introduction.xml b/docs/quickstart-guide/zh/introduction.xml
deleted file mode 100644
index 4fc7ade..0000000
--- a/docs/quickstart-guide/zh/introduction.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-<chapter id="introduction">
- <title>快速入手</title>
- <para>本简短的指南给出了如何下载、安装ActiveMQ,以及尽快开始使用ActiveMQ。</para>
- <para>我们强烈建议当下载安装完成后,运行ActiveMQ的例子来了解ActiveMQ。我们有70多个例子来展示几乎
- 所有ActiveMQ的功能。</para>
- <para>本指南不能代替用户手册。用户手册包括更加完整和深入的信息,供用户进一步全面掌握ActiveMQ。</para>
-</chapter>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/master.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/master.xml b/docs/quickstart-guide/zh/master.xml
deleted file mode 100644
index 8092d18..0000000
--- a/docs/quickstart-guide/zh/master.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
- "../../../lib/docbook-support/support/docbook-dtd/docbookx.dtd" [
- <!ENTITY about SYSTEM "about.xml">
- <!ENTITY download SYSTEM "download.xml">
- <!ENTITY examples SYSTEM "examples.xml">
- <!ENTITY installation SYSTEM "installation.xml">
- <!ENTITY introduction SYSTEM "introduction.xml">
- <!ENTITY notice SYSTEM "notice.xml">
- <!ENTITY running SYSTEM "running.xml">
- ]>
-<book lang="en">
- <bookinfo>
- <title>ActiveMQ快速指南</title>
- <subtitle>Putting the buzz in messaging</subtitle>
- </bookinfo>
-
- <toc></toc>
-
- ¬ice;
- &about;
- &introduction;
- &download;
- &installation;
- &running;
- &examples;
-</book>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/notice.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/notice.xml b/docs/quickstart-guide/zh/notice.xml
deleted file mode 100644
index a9db5e5..0000000
--- a/docs/quickstart-guide/zh/notice.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-
-
-<chapter id="notice">
- <title>法律声明</title>
-
- <para>Red Hat, Inc. 以及其他公司2010年版权所有。</para>
- <para>Red Hat公司依照 CC-BY-SA 3.0 Unported(Creative Commons
- Attribution-Share Alike)条款之规定授权用戶是用本手册中的文字和插图。</para>
- <para>有关 CC-BY-SA 的解释请访问<ulink url="http://creativecommons.org/licenses/by-sa/3.0/">http://creativecommons.org/licenses/by-sa/3.0/</ulink>。根据CC-BY-SA的规定,如果要发布本文档或任何本文档的修改版本,都必须给出原始版本文档的URL。</para>
- <para>Red Hat 作为本文档的授权方声明在相关法律允许的最大范围内放弃CC-BY-SA第4d节所规定的权利。</para>
-</chapter>
-
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/cb7774cf/docs/quickstart-guide/zh/running.xml
----------------------------------------------------------------------
diff --git a/docs/quickstart-guide/zh/running.xml b/docs/quickstart-guide/zh/running.xml
deleted file mode 100644
index 867ab80..0000000
--- a/docs/quickstart-guide/zh/running.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ============================================================================= -->
-<!-- Copyright © 2009 Red Hat, Inc. and others. -->
-<!-- -->
-<!-- The text of and illustrations in this document are licensed by Red Hat under -->
-<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
-<!-- -->
-<!-- An explanation of CC-BY-SA is available at -->
-<!-- -->
-<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
-<!-- -->
-<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
-<!-- of it, you must provide the URL for the original version. -->
-<!-- -->
-<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
-<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
-<!-- permitted by applicable law. -->
-<!-- ============================================================================= -->
-<chapter id="running">
- <title>Starting The Server</title>
- <section id="running.standalone">
- <title>单独ActiveMQ</title>
- <para>要运行单独的ActiveMQ服务,打开一个命令行窗口,进入到ActiveMQ的<literal>bin</literal>
- 目录下,执行<literal>./run.sh</literal> (或者在Windows下 <literal
- >run.bat</literal>)。你将看到如下的输出:</para>
- <programlisting>
- bin$ ./run.sh
-
- 15:05:54,108 INFO @main [ActiveMQBootstrapServer] Starting ActiveMQ server
- ...
- 15:06:02,566 INFO @main [ActiveMQServerImpl] ActiveMQ Server version
- 2.0.0.CR3 (yellowjacket, 111) started
- </programlisting>
- <para>这表明ActiveMQ已经启动并运行了。</para>
- <para>默认情况下,不论是启动还是停止脚本都使用<literal>config/stand-alone/non-clustered</literal>
- 下的配置文件。要使用不同的配置目录,可运行<literal>./run.sh ../config/stand-alone/clustered</literal>
- 或者其它选定的目录。同样方法适用于停止脚本。</para>
- </section>
- <section id="running.jboss.as5">
- <title>ActiveMQ在JBoss AS 5.x中运行</title>
- <para>要在JBoss AS 5运行ActiveMQ,你需要创建<link
- linkend="installation.jboss.as5">安装有ActiveMQ的AS 5的配置</link>。然后用这个配置启动AS 5。
- 例如,要运行一个带有<emphasis>非集群</emphasis>的ActiveMQ服务的AS 5,进入<literal
- >$JBOSS_HOME/bin</literal>目录,然后键入:</para>
- <programlisting>
- bin$ ./run.sh -c default-with-activemq
-
- 15:18:35,460 INFO [ServerImpl] Starting JBoss (Microcontainer)...
- 15:18:35,462 INFO [ServerImpl] Release ID: JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=
- JBoss_5_1_0_GA date=200905221053)
- ...
- 15:19:30,305 INFO [ActiveMQServerImpl] ActiveMQ Server version
- 2.0.0.CR3 (yellowjacket, 111) started
- ...
- 15:19:43,601 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=
- JBoss_5_1_0_GA date=200905221053)]Started in 1m:14s:556ms
- </programlisting>
- </section>
- <section id="running.jboss.as4">
- <title>ActiveMQ在JBoss AS 4中运行</title>
- <para>首先按照与JBoss AS 5相同的步骤创建<link linkend="installation.jboss.as4">安装有ActiveMQ的AS 4配置
- </link>然后以相同的方式启动AS。</para>
- </section>
- <section id="running.jboss.as6">
- <title>ActiveMQ在JBoss AS 6.0中运行</title>
- <para>从JBoss AS 6.0 M3开始,ActiveMQ已经是默认的(内建)JMS提供者。所以无需安装即可运行。</para>
- </section>
-</chapter>
[3/4] activemq-6 git commit: ACTIVEMQ6-20 removing twitter integration
Posted by an...@apache.org.
ACTIVEMQ6-20 removing twitter integration
https://issues.apache.org/jira/browse/ACTIVEMQ6-20
this has been identified as a dead feature.
It was only useful for presentations...
it had its time and we have better examples we can use...
It's time for this feature to go!
Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/a3afd625
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/a3afd625
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/a3afd625
Branch: refs/heads/master
Commit: a3afd62575ba97b019a2c346a7b2cfb13974d33f
Parents: cb7774c
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Dec 2 12:15:25 2014 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Dec 2 12:33:16 2014 -0500
----------------------------------------------------------------------
.../activemq/rest/ActiveMQRestLogger.java | 3 -
examples/core/twitter-connector/pom.xml | 184 ------
examples/core/twitter-connector/readme.html | 96 ---
.../core/example/TwitterConnectorExample.java | 121 ----
.../server0/activemq-configuration.xml | 71 ---
.../src/main/resources/server0/activemq-jms.xml | 19 -
.../main/resources/server0/activemq-users.xml | 7 -
.../activemq-twitter-integration/pom.xml | 44 --
.../integration/twitter/TwitterConstants.java | 99 ---
.../TwitterIncomingConnectorServiceFactory.java | 52 --
.../TwitterOutgoingConnectorServiceFactory.java | 49 --
.../twitter/impl/IncomingTweetsHandler.java | 234 -------
.../twitter/impl/OutgoingTweetsHandler.java | 266 --------
.../activemq/twitter/ActiveMQTwitterBundle.java | 35 -
.../activemq/twitter/ActiveMQTwitterLogger.java | 58 --
pom.xml | 14 -
tests/integration-tests/pom.xml | 9 -
.../tests/integration/twitter/TwitterTest.java | 637 -------------------
18 files changed, 1998 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
----------------------------------------------------------------------
diff --git a/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
index bd7bb5c..e14b681 100644
--- a/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
+++ b/activemq-rest/src/main/java/org/apache/activemq/rest/ActiveMQRestLogger.java
@@ -45,9 +45,6 @@ import org.jboss.logging.annotations.MessageLogger;
@MessageLogger(projectCode = "AMQ")
public interface ActiveMQRestLogger extends BasicLogger
{
- /**
- * The twitter logger.
- */
ActiveMQRestLogger LOGGER = Logger.getMessageLogger(ActiveMQRestLogger.class, ActiveMQRestLogger.class.getPackage().getName());
@LogMessage(level = Logger.Level.INFO)
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/pom.xml b/examples/core/twitter-connector/pom.xml
deleted file mode 100644
index 8299070..0000000
--- a/examples/core/twitter-connector/pom.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.core</groupId>
- <artifactId>core-examples</artifactId>
- <version>6.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>activemq-twitter-example</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ6 Twitter Example</name>
-
- <properties>
- <TWITTER_CONSUMER_KEY>consumerKey</TWITTER_CONSUMER_KEY>
- <TWITTER_CONSUMER_SECRET>consumerSecret</TWITTER_CONSUMER_SECRET>
- <TWITTER_ACCESS_TOKEN>twitterAccess</TWITTER_ACCESS_TOKEN>
- <TWITTER_ACCESS_TOKEN_SECRET>twitterToken</TWITTER_ACCESS_TOKEN_SECRET>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-commons</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- <version>${netty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
- <version>1.1.0.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.naming</groupId>
- <artifactId>jnp-client</artifactId>
- <version>5.0.5.Final</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.jms</groupId>
- <artifactId>jboss-jms-api_2.0_spec</artifactId>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>start</id>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <waitOnStart>true</waitOnStart>
- <hornetqConfigurationDir>${basedir}/target/classes/server0</hornetqConfigurationDir>
- <systemProperties>
- <property>
- <name>build.directory</name>
- <value>${basedir}/target/</value>
- </property>
- <property>
- <name>TWITTER_CONSUMER_KEY</name>
- <value>${TWITTER_CONSUMER_KEY}</value>
- </property>
- <property>
- <name>TWITTER_CONSUMER_SECRET</name>
- <value>${TWITTER_CONSUMER_SECRET}</value>
- </property>
- <property>
- <name>TWITTER_ACCESS_TOKEN</name>
- <value>${TWITTER_ACCESS_TOKEN}</value>
- </property>
- <property>
- <name>TWITTER_ACCESS_TOKEN_SECRET</name>
- <value>${TWITTER_ACCESS_TOKEN_SECRET}</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <waitOnStart>false</waitOnStart>
- <hornetqConfigurationDir>${basedir}/target/classes/server0</hornetqConfigurationDir>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.core</groupId>
- <artifactId>activemq-twitter-example</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-twitter-integration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-jms-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- <version>${netty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
- <version>1.1.0.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.naming</groupId>
- <artifactId>jnpserver</artifactId>
- <version>5.0.3.GA</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>example</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>org.apache.activemq.core.example.TwitterConnectorExample</mainClass>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/readme.html
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/readme.html b/examples/core/twitter-connector/readme.html
deleted file mode 100644
index bfd8c3f..0000000
--- a/examples/core/twitter-connector/readme.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<html>
- <head>
- <title>ActiveMQ Twitter Connector Service Example</title>
- <link rel="stylesheet" type="text/css" href="../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../common/prettify.css" />
- <script type="text/javascript" src="../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>Twitter Connector Service Example</h1>
-
- <p>This example shows you how to configure ActiveMQ to use the Twitter Connector Service.</p>
-
- <p>ActiveMQ supports 2 types of Twitter connector, incoming and outgoing.
- Incoming connector consumes from twitter and forwards to a configurable address.
- Outgoing connector consumes from a configurable address and forwards to twitter.
- </p>
-
- <p>In this example, incoming connector and outgoing connector is related to same twitter account.
- So if you send a message to an outgoing address, outgoing connector forwards it to twitter,
- and then incoming connector consumes it and forwards to incoming address.</p>
-
- <h2>Example step-by-step</h2>
- <p><i>To run the server, simply type <code>mvn-Dtwitter.consumerKey=consumer -Dtwitter.consumerSecret=secret -Dtwitter.accessToken=token -Dtwitter.accessTokenSecret=secret verify</code>
- from this directory but replacing the system properties with those of the twitter account you want to use. Then run the example
- by using the command <code>mvn -Pexample package</code></p>
-
-
- <ol>
- <li>First we need to create a ClientSessionFactory with Netty transport configuration</li>
- <pre class="prettyprint">
- <code>csf = ActiveMQClient.createClientSessionFactory(new TransportConfiguration(NettyConnectorFactory.class.getName()));</code>
- </pre>
-
- <li>We create a core session with auto-commit mode</li>
- <pre class="prettyprint">
- <code>session = csf.createSession(true,true);</code>
- </pre>
-
- <li>We Create a core producer for queue.outgoingQueue</li>
- <pre class="prettyprint">
- <code>ClientProducer cp = session.createProducer(OUTGOING_QUEUE);</code>
- </pre>
-
- <li>We create a core consumer for queue.incomingQueue</li>
- <pre class="prettyprint">
- <code>ClientConsumer cc = session.createConsumer(INCOMING_QUEUE);</code>
- </pre>
-
- <li>We create a core message that we are going to send</li>
- <pre class="prettyprint">
- <code>ClientMessage cm = session.createMessage(org.apache.activemq.api.core.Message.TEXT_TYPE,true);
-String testMessage = System.currentTimeMillis() + ": twitter connector test example";
-cm.getBodyBuffer().writeString(testMessage);</code>
- </pre>
-
- <li>We send the message to queue.outgoingQueue</li>
- <pre class="prettyprint">
- <code>cp.send(cm);</code>
- </pre>
-
- <li>We start the session</li>
- <pre class="prettyprint">
- <code>session.start();</code>
- </pre>
-
- <li>We will receive a message from queue.incomingQueue.
- Outgoing connector forwards a message(we sent before) to twitter immediately.
- Since incoming connector consumes from twitter and forwards to queue.incomingQueue
- every 60 seconds, It will be received in 60+x seconds.</li>
- <pre class="prettyprint">
- <code>ClientMessage received = cc.receive(70 * 1000);
-received.acknowledge();
-String receivedText = received.getBodyBuffer().readString();</code>
- </pre>
-
- <li>And finally, remember to close core session and ClientSessionFactory in a <code>finally</code> block.</li>
-
- <pre class="prettyprint">
- <code>finally
-{
- if(session != null)
- {
- session.close();
- }
- if(csf != null)
- {
- csf.close();
- }
-}</code>
- </pre>
-
-
-
- </ol>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/src/main/java/org/apache/activemq/core/example/TwitterConnectorExample.java
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/src/main/java/org/apache/activemq/core/example/TwitterConnectorExample.java b/examples/core/twitter-connector/src/main/java/org/apache/activemq/core/example/TwitterConnectorExample.java
deleted file mode 100644
index cede6a0..0000000
--- a/examples/core/twitter-connector/src/main/java/org/apache/activemq/core/example/TwitterConnectorExample.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.core.example;
-
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientProducer;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.ActiveMQClient;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory;
-
-/**
- * A simple example of using twitter connector service.
- *
- * @author <a href="tm.igarashi@gmail.com">Tomohisa Igarashi</a>
- */
-public class TwitterConnectorExample
-{
- private static final String INCOMING_QUEUE = "queue.incomingQueue";
- private static final String OUTGOING_QUEUE = "queue.outgoingQueue";
-
- public static void main(final String[] args) throws Exception
- {
- ServerLocator locator = null;
- ClientSessionFactory csf = null;
- ClientSession session = null;
- try
- {
- String testMessage = System.currentTimeMillis() + ": " + System.getProperty("twitter.example.alternativeMessage");
- if(testMessage == null || testMessage.trim().equals("")) {
- testMessage = System.currentTimeMillis() + ": ### Hello, ActiveMQ fans!! We are now experiencing so fast, so reliable and so exciting messaging never seen before ;-) ###";
- }
-
- // Step 1. Create a ClientSessionFactory
-
-
- locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
-
- csf = locator.createSessionFactory();
-
- // Step 2. Create a core session.
- session = csf.createSession(true,true);
-
- // Step 3. Create a core producer for queue.outgoingQueue.
- ClientProducer cp = session.createProducer(OUTGOING_QUEUE);
-
- // Step 4. Create a core consumer for queue.incomingQueue.
- ClientConsumer cc = session.createConsumer(INCOMING_QUEUE);
-
- // Step 5. Create a core message.
- ClientMessage cm = session.createMessage(org.apache.activemq.api.core.Message.TEXT_TYPE,true);
- cm.getBodyBuffer().writeString(testMessage);
-
- // Step 6. Send a message to queue.outgoingQueue.
- cp.send(cm);
- System.out.println("#### Sent a message to " + OUTGOING_QUEUE + ": " + testMessage);
-
- // Step 7. Start the session.
- session.start();
-
- // Step 8. Receive a message from queue.incomingQueue.
- // Outgoing connector forwards a message(sent at Step 6.) to twitter immediately.
- // Since incoming connector consumes from twitter and forwards to queue.incomingQueue
- // every 60 seconds, It will be received in 60+x seconds.
- System.out.println("#### A message will be received in 60 seconds. Please wait...");
- ClientMessage received = cc.receive(70 * 1000);
- received.acknowledge();
- String receivedText = received.getBodyBuffer().readString();
-
- while(!receivedText.equals(testMessage))
- {
- // ignoring other tweets
- received = cc.receiveImmediate();
- if(received == null) {
- // no other tweets. test message has gone...
- return;
- }
-
- received.acknowledge();
- receivedText = received.getBodyBuffer().readString();
- }
-
- System.out.println("#### Received a message from " + INCOMING_QUEUE + ": " + receivedText);
- }
- finally
- {
- // Step 9. Be sure to close some resources.
- if(session != null)
- {
- session.close();
- }
- if(csf != null)
- {
- csf.close();
- }
-
- if (locator != null)
- {
- locator.close();
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/src/main/resources/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/src/main/resources/server0/activemq-configuration.xml b/examples/core/twitter-connector/src/main/resources/server0/activemq-configuration.xml
deleted file mode 100644
index 2db5f46..0000000
--- a/examples/core/twitter-connector/src/main/resources/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<configuration xmlns="urn:activemq"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-
- <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
-
- <journal-directory>target/server0/data/messaging/journal</journal-directory>
-
- <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
-
- <paging-directory>target/server0/data/messaging/paging</paging-directory>
- <!-- Connectors -->
-
- <connectors>
- <connector name="netty-connector">
- <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
- </connector>
- </connectors>
-
- <!-- Acceptors -->
- <acceptors>
- <acceptor name="netty-acceptor">
- <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
- </acceptor>
- </acceptors>
-
- <!-- Other config -->
-
- <security-settings>
- <!--security for example queue-->
- <security-setting match="queue.incomingQueue">
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- <security-setting match="queue.outgoingQueue">
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
-
- <queues>
- <queue name="queue.incomingQueue">
- <address>queue.incomingQueue</address>
- </queue>
- <queue name="queue.outgoingQueue">
- <address>queue.outgoingQueue</address>
- </queue>
- </queues>
-
- <connector-services>
- <connector-service name="my-incoming-tweets">
- <factory-class>org.apache.activemq.integration.twitter.TwitterIncomingConnectorServiceFactory</factory-class>
- <param key="queue" value="queue.incomingQueue"/>
- <param key="consumerKey" value="${twitter.consumerKey}"/>
- <param key="consumerSecret" value="${twitter.consumerSecret}"/>
- <param key="accessToken" value="${twitter.accessToken}"/>
- <param key="accessTokenSecret" value="${twitter.accessTokenSecret}"/>
- <param key="interval" value="60"/>
- </connector-service>
- <connector-service name="my-outgoing-tweets">
- <factory-class>org.apache.activemq.integration.twitter.TwitterOutgoingConnectorServiceFactory</factory-class>
- <param key="queue" value="queue.outgoingQueue"/>
- <param key="consumerKey" value="${twitter.consumerKey}"/>
- <param key="consumerSecret" value="${twitter.consumerSecret}"/>
- <param key="accessToken" value="${twitter.accessToken}"/>
- <param key="accessTokenSecret" value="${twitter.accessTokenSecret}"/>
- </connector-service>
- </connector-services>
-
-</configuration>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/src/main/resources/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/src/main/resources/server0/activemq-jms.xml b/examples/core/twitter-connector/src/main/resources/server0/activemq-jms.xml
deleted file mode 100644
index 452b958..0000000
--- a/examples/core/twitter-connector/src/main/resources/server0/activemq-jms.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<configuration xmlns="urn:activemq"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
- <!--the connection factory used by the example-->
- <connection-factory name="ConnectionFactory">
- <connectors>
- <connector-ref connector-name="netty-connector"/>
- </connectors>
- <entries>
- <entry name="ConnectionFactory"/>
- </entries>
- </connection-factory>
-
- <!--the queue used by the example-->
- <queue name="exampleQueue">
- <entry name="/queue/exampleQueue"/>
- </queue>
-
-</configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/examples/core/twitter-connector/src/main/resources/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/core/twitter-connector/src/main/resources/server0/activemq-users.xml b/examples/core/twitter-connector/src/main/resources/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/core/twitter-connector/src/main/resources/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
- <!-- the default user. this is used where username is null-->
- <defaultuser name="guest" password="guest">
- <role name="guest"/>
- </defaultuser>
-</configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/pom.xml
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/pom.xml b/integration/activemq-twitter-integration/pom.xml
deleted file mode 100644
index 8248b0c..0000000
--- a/integration/activemq-twitter-integration/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-pom</artifactId>
- <version>6.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>activemq-twitter-integration</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ6 Twitter Integration</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-processor</artifactId>
- </dependency>
-
- <!--
- JBoss Logging
- -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.twitter4j</groupId>
- <artifactId>twitter4j-core</artifactId>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterConstants.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterConstants.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterConstants.java
deleted file mode 100644
index e171329..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterConstants.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.integration.twitter;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A TwitterConstants
- *
- * @author <a href="tm.igarashi@gmail.com">Tomohisa Igarashi</a>
- */
-public final class TwitterConstants
-{
- public static final String KEY_ID = "id";
- public static final String KEY_SOURCE = "source";
- public static final String KEY_CREATED_AT = "createdAt";
- public static final String KEY_IS_TRUNCATED = "isTruncated";
- public static final String KEY_IN_REPLY_TO_STATUS_ID = "inReplyToStatusId";
- public static final String KEY_IN_REPLY_TO_USER_ID = "inReplyToUserId";
- public static final String KEY_IN_REPLY_TO_SCREEN_NAME = "inReplyToScreenName";
- public static final String KEY_IS_FAVORITED = "isFavorited";
- public static final String KEY_IS_RETWEET = "isRetweet";
- public static final String KEY_CONTRIBUTORS = "contributors";
- public static final String KEY_GEO_LOCATION_LATITUDE = "geoLocation.latitude";
- public static final String KEY_GEO_LOCATION_LONGITUDE = "geoLocation.longitude";
- public static final String KEY_PLACE_ID = "place.id";
- public static final String KEY_DISPLAY_COODINATES = "displayCoodinates";
-
- public static final int DEFAULT_POLLING_INTERVAL_SECS = 10;
- public static final int DEFAULT_PAGE_SIZE = 100;
- public static final int FIRST_ATTEMPT_PAGE_SIZE = 1;
- public static final int START_SINCE_ID = 1;
- public static final int INITIAL_MESSAGE_BUFFER_SIZE = 50;
-
- public static final Set<String> ALLOWABLE_INCOMING_CONNECTOR_KEYS;
- public static final Set<String> REQUIRED_INCOMING_CONNECTOR_KEYS;
-
- public static final Set<String> ALLOWABLE_OUTGOING_CONNECTOR_KEYS;
- public static final Set<String> REQUIRED_OUTGOING_CONNECTOR_KEYS;
-
- public static final String CONSUMER_KEY = "consumerKey";
- public static final String CONSUMER_SECRET = "consumerSecret";
- public static final String ACCESS_TOKEN = "accessToken";
- public static final String ACCESS_TOKEN_SECRET = "accessTokenSecret";
- public static final String QUEUE_NAME = "queue";
- public static final String INCOMING_INTERVAL = "interval";
-
- static
- {
- ALLOWABLE_INCOMING_CONNECTOR_KEYS = new HashSet<String>();
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(CONSUMER_KEY);
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(CONSUMER_SECRET);
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(ACCESS_TOKEN);
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(ACCESS_TOKEN_SECRET);
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(QUEUE_NAME);
- ALLOWABLE_INCOMING_CONNECTOR_KEYS.add(INCOMING_INTERVAL);
-
- REQUIRED_INCOMING_CONNECTOR_KEYS = new HashSet<String>();
- REQUIRED_INCOMING_CONNECTOR_KEYS.add(CONSUMER_KEY);
- REQUIRED_INCOMING_CONNECTOR_KEYS.add(CONSUMER_SECRET);
- REQUIRED_INCOMING_CONNECTOR_KEYS.add(ACCESS_TOKEN);
- REQUIRED_INCOMING_CONNECTOR_KEYS.add(ACCESS_TOKEN_SECRET);
- REQUIRED_INCOMING_CONNECTOR_KEYS.add(QUEUE_NAME);
-
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS = new HashSet<String>();
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS.add(CONSUMER_KEY);
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS.add(CONSUMER_SECRET);
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS.add(ACCESS_TOKEN);
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS.add(ACCESS_TOKEN_SECRET);
- ALLOWABLE_OUTGOING_CONNECTOR_KEYS.add(QUEUE_NAME);
-
- REQUIRED_OUTGOING_CONNECTOR_KEYS = new HashSet<String>();
- REQUIRED_OUTGOING_CONNECTOR_KEYS.add(CONSUMER_KEY);
- REQUIRED_OUTGOING_CONNECTOR_KEYS.add(CONSUMER_SECRET);
- REQUIRED_OUTGOING_CONNECTOR_KEYS.add(ACCESS_TOKEN);
- REQUIRED_OUTGOING_CONNECTOR_KEYS.add(ACCESS_TOKEN_SECRET);
- REQUIRED_OUTGOING_CONNECTOR_KEYS.add(QUEUE_NAME);
- }
-
- private TwitterConstants()
- {
- // utility class
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterIncomingConnectorServiceFactory.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterIncomingConnectorServiceFactory.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterIncomingConnectorServiceFactory.java
deleted file mode 100644
index 0934dad..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterIncomingConnectorServiceFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.integration.twitter;
-
-import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.server.ConnectorService;
-import org.apache.activemq.core.server.ConnectorServiceFactory;
-import org.apache.activemq.integration.twitter.impl.IncomingTweetsHandler;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * Created Jun 29, 2010
- */
-public class TwitterIncomingConnectorServiceFactory implements ConnectorServiceFactory
-{
- public ConnectorService createConnectorService(String connectorName, final Map<String, Object> configuration,
- final StorageManager storageManager,
- final PostOffice postOffice,
- final ScheduledExecutorService scheduledThreadPool)
- {
- return new IncomingTweetsHandler(connectorName, configuration, storageManager, postOffice, scheduledThreadPool);
- }
-
- public Set<String> getAllowableProperties()
- {
- return TwitterConstants.ALLOWABLE_INCOMING_CONNECTOR_KEYS;
- }
-
- public Set<String> getRequiredProperties()
- {
- return TwitterConstants.REQUIRED_INCOMING_CONNECTOR_KEYS;
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterOutgoingConnectorServiceFactory.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterOutgoingConnectorServiceFactory.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterOutgoingConnectorServiceFactory.java
deleted file mode 100644
index 1ceb3c9..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/TwitterOutgoingConnectorServiceFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.integration.twitter;
-
-import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.server.ConnectorService;
-import org.apache.activemq.core.server.ConnectorServiceFactory;
-import org.apache.activemq.integration.twitter.impl.OutgoingTweetsHandler;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * Created Jun 29, 2010
- */
-public class TwitterOutgoingConnectorServiceFactory implements ConnectorServiceFactory
-{
- public ConnectorService createConnectorService(String connectorName, Map<String, Object> configuration, StorageManager storageManager, PostOffice postOffice, ScheduledExecutorService scheduledThreadPool)
- {
- return new OutgoingTweetsHandler(connectorName, configuration, postOffice);
- }
-
- public Set<String> getAllowableProperties()
- {
- return TwitterConstants.ALLOWABLE_OUTGOING_CONNECTOR_KEYS;
- }
-
- public Set<String> getRequiredProperties()
- {
- return TwitterConstants.REQUIRED_OUTGOING_CONNECTOR_KEYS;
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/IncomingTweetsHandler.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/IncomingTweetsHandler.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/IncomingTweetsHandler.java
deleted file mode 100644
index 15279a5..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/IncomingTweetsHandler.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.integration.twitter.impl;
-
-import java.util.Map;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.persistence.StorageManager;
-import org.apache.activemq.core.postoffice.Binding;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.server.ConnectorService;
-import org.apache.activemq.core.server.ServerMessage;
-import org.apache.activemq.core.server.impl.ServerMessageImpl;
-import org.apache.activemq.integration.twitter.TwitterConstants;
-import org.apache.activemq.twitter.ActiveMQTwitterLogger;
-import org.apache.activemq.utils.ConfigurationHelper;
-import twitter4j.GeoLocation;
-import twitter4j.Paging;
-import twitter4j.Place;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.Twitter;
-import twitter4j.TwitterFactory;
-import twitter4j.http.AccessToken;
-
-/**
- * IncomingTweetsHandler consumes from twitter and forwards to the
- * configured ActiveMQ address.
- */
-public class IncomingTweetsHandler implements ConnectorService
-{
- private final String connectorName;
-
- private final String consumerKey;
-
- private final String consumerSecret;
-
- private final String accessToken;
-
- private final String accessTokenSecret;
-
- private final String queueName;
-
- private final int intervalSeconds;
-
- private final StorageManager storageManager;
-
- private final PostOffice postOffice;
-
- private Paging paging;
-
- private Twitter twitter;
-
- private boolean isStarted = false;
-
- private final ScheduledExecutorService scheduledPool;
-
- private ScheduledFuture<?> scheduledFuture;
-
- public IncomingTweetsHandler(final String connectorName,
- final Map<String, Object> configuration,
- final StorageManager storageManager,
- final PostOffice postOffice,
- final ScheduledExecutorService scheduledThreadPool)
- {
- this.connectorName = connectorName;
- this.consumerKey = ConfigurationHelper.getStringProperty(TwitterConstants.CONSUMER_KEY, null, configuration);
- this.consumerSecret = ConfigurationHelper.getStringProperty(TwitterConstants.CONSUMER_SECRET, null, configuration);
- this.accessToken = ConfigurationHelper.getStringProperty(TwitterConstants.ACCESS_TOKEN, null, configuration);
- this.accessTokenSecret = ConfigurationHelper.getStringProperty(TwitterConstants.ACCESS_TOKEN_SECRET, null, configuration);
- this.queueName = ConfigurationHelper.getStringProperty(TwitterConstants.QUEUE_NAME, null, configuration);
- Integer intervalSeconds = ConfigurationHelper.getIntProperty(TwitterConstants.INCOMING_INTERVAL, 0, configuration);
- if (intervalSeconds > 0)
- {
- this.intervalSeconds = intervalSeconds;
- }
- else
- {
- this.intervalSeconds = TwitterConstants.DEFAULT_POLLING_INTERVAL_SECS;
- }
- this.storageManager = storageManager;
- this.postOffice = postOffice;
- this.scheduledPool = scheduledThreadPool;
- }
-
- public void start() throws Exception
- {
- Binding b = postOffice.getBinding(new SimpleString(queueName));
- if (b == null)
- {
- throw new Exception(connectorName + ": queue " + queueName + " not found");
- }
-
- paging = new Paging();
- TwitterFactory tf = new TwitterFactory();
- this.twitter = tf.getOAuthAuthorizedInstance(this.consumerKey,
- this.consumerSecret,
- new AccessToken(this.accessToken,
- this.accessTokenSecret));
- this.twitter.verifyCredentials();
-
- // getting latest ID
- this.paging.setCount(TwitterConstants.FIRST_ATTEMPT_PAGE_SIZE);
-
- // If I used annotations here, it won't compile under JDK 1.7
- ResponseList res = this.twitter.getHomeTimeline(paging);
- this.paging.setSinceId(((Status) res.get(0)).getId());
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + " initialise(): got latest ID: " + this.paging.getSinceId());
-
- // TODO make page size configurable
- this.paging.setCount(TwitterConstants.DEFAULT_PAGE_SIZE);
-
- scheduledFuture = this.scheduledPool.scheduleWithFixedDelay(new TweetsRunnable(),
- intervalSeconds,
- intervalSeconds,
- TimeUnit.SECONDS);
- isStarted = true;
- }
-
- public void stop() throws Exception
- {
- if (!isStarted)
- {
- return;
- }
- scheduledFuture.cancel(true);
- paging = null;
- isStarted = false;
- }
-
- public boolean isStarted()
- {
- return isStarted;
- }
-
- private void poll() throws Exception
- {
- // get new tweets
- // If I used annotations here, it won't compile under JDK 1.7
- ResponseList res = this.twitter.getHomeTimeline(paging);
-
- if (res == null || res.size() == 0)
- {
- return;
- }
-
- for (int i = res.size() - 1; i >= 0; i--)
- {
- Status status = (Status) res.get(i);
-
- ServerMessage msg = new ServerMessageImpl(this.storageManager.generateID(),
- TwitterConstants.INITIAL_MESSAGE_BUFFER_SIZE);
- msg.setAddress(new SimpleString(this.queueName));
- msg.setDurable(true);
- msg.encodeMessageIDToBuffer();
-
- putTweetIntoMessage(status, msg);
-
- this.postOffice.route(msg, false);
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": routed: " + status.toString());
- }
-
- this.paging.setSinceId(((Status) res.get(0)).getId());
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": update latest ID: " + this.paging.getSinceId());
- }
-
- private void putTweetIntoMessage(final Status status, final ServerMessage msg)
- {
- msg.getBodyBuffer().writeString(status.getText());
- msg.putLongProperty(TwitterConstants.KEY_ID, status.getId());
- msg.putStringProperty(TwitterConstants.KEY_SOURCE, status.getSource());
-
- msg.putLongProperty(TwitterConstants.KEY_CREATED_AT, status.getCreatedAt().getTime());
- msg.putBooleanProperty(TwitterConstants.KEY_IS_TRUNCATED, status.isTruncated());
- msg.putLongProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID, status.getInReplyToStatusId());
- msg.putIntProperty(TwitterConstants.KEY_IN_REPLY_TO_USER_ID, status.getInReplyToUserId());
- msg.putBooleanProperty(TwitterConstants.KEY_IS_FAVORITED, status.isFavorited());
- msg.putBooleanProperty(TwitterConstants.KEY_IS_RETWEET, status.isRetweet());
- msg.putObjectProperty(TwitterConstants.KEY_CONTRIBUTORS, status.getContributors());
- GeoLocation gl;
- if ((gl = status.getGeoLocation()) != null)
- {
- msg.putDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE, gl.getLatitude());
- msg.putDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LONGITUDE, gl.getLongitude());
- }
- Place place;
- if ((place = status.getPlace()) != null)
- {
- msg.putStringProperty(TwitterConstants.KEY_PLACE_ID, place.getId());
- }
- }
-
- public String getName()
- {
- return connectorName;
- }
-
- private final class TweetsRunnable implements Runnable
- {
- /**
- * TODO streaming API support
- * TODO rate limit support
- */
- public void run()
- {
- // Avoid canceling the task with RuntimeException
- try
- {
- poll();
- }
- catch (Throwable t)
- {
- ActiveMQTwitterLogger.LOGGER.errorPollingTwitter(t);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/OutgoingTweetsHandler.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/OutgoingTweetsHandler.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/OutgoingTweetsHandler.java
deleted file mode 100644
index 10213a7..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/integration/twitter/impl/OutgoingTweetsHandler.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.integration.twitter.impl;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.activemq.api.core.SimpleString;
-import org.apache.activemq.core.filter.Filter;
-import org.apache.activemq.core.postoffice.Binding;
-import org.apache.activemq.core.postoffice.PostOffice;
-import org.apache.activemq.core.server.ConnectorService;
-import org.apache.activemq.core.server.Consumer;
-import org.apache.activemq.core.server.HandleStatus;
-import org.apache.activemq.core.server.ActiveMQServerLogger;
-import org.apache.activemq.core.server.MessageReference;
-import org.apache.activemq.core.server.Queue;
-import org.apache.activemq.core.server.ServerMessage;
-import org.apache.activemq.integration.twitter.TwitterConstants;
-import org.apache.activemq.twitter.ActiveMQTwitterLogger;
-import org.apache.activemq.utils.ConfigurationHelper;
-import twitter4j.GeoLocation;
-import twitter4j.StatusUpdate;
-import twitter4j.Twitter;
-import twitter4j.TwitterException;
-import twitter4j.TwitterFactory;
-import twitter4j.http.AccessToken;
-
-/**
- * OutgoingTweetsHandler consumes from configured ActiveMQ address
- * and forwards to the twitter.
- */
-public class OutgoingTweetsHandler implements Consumer, ConnectorService
-{
- private final String connectorName;
-
- private final String consumerKey;
-
- private final String consumerSecret;
-
- private final String accessToken;
-
- private final String accessTokenSecret;
-
- private final String queueName;
-
- private final PostOffice postOffice;
-
- private Twitter twitter = null;
-
- private Queue queue = null;
-
- private Filter filter = null;
-
- private boolean isStarted = false;
-
-
- public String debug()
- {
- return toString();
- }
-
- public OutgoingTweetsHandler(final String connectorName,
- final Map<String, Object> configuration,
- final PostOffice postOffice)
- {
- this.connectorName = connectorName;
- this.consumerKey = ConfigurationHelper.getStringProperty(TwitterConstants.CONSUMER_KEY, null, configuration);
- this.consumerSecret = ConfigurationHelper.getStringProperty(TwitterConstants.CONSUMER_SECRET, null, configuration);
- this.accessToken = ConfigurationHelper.getStringProperty(TwitterConstants.ACCESS_TOKEN, null, configuration);
- this.accessTokenSecret = ConfigurationHelper.getStringProperty(TwitterConstants.ACCESS_TOKEN_SECRET, null, configuration);
- this.queueName = ConfigurationHelper.getStringProperty(TwitterConstants.QUEUE_NAME, null, configuration);
- this.postOffice = postOffice;
- }
-
- /**
- * TODO streaming API support
- * TODO rate limit support
- */
- public synchronized void start() throws Exception
- {
- if (this.isStarted)
- {
- return;
- }
-
- if (this.connectorName == null || this.connectorName.trim().equals(""))
- {
- throw new Exception("invalid connector name: " + this.connectorName);
- }
-
- if (this.queueName == null || this.queueName.trim().equals(""))
- {
- throw new Exception("invalid queue name: " + queueName);
- }
-
- SimpleString name = new SimpleString(this.queueName);
- Binding b = this.postOffice.getBinding(name);
- if (b == null)
- {
- throw new Exception(connectorName + ": queue " + queueName + " not found");
- }
- this.queue = (Queue) b.getBindable();
-
- TwitterFactory tf = new TwitterFactory();
- this.twitter = tf.getOAuthAuthorizedInstance(this.consumerKey,
- this.consumerSecret,
- new AccessToken(this.accessToken,
- this.accessTokenSecret));
- this.twitter.verifyCredentials();
-
- // TODO make filter-string configurable
- // this.filter = FilterImpl.createFilter(filterString);
- this.filter = null;
-
- this.queue.addConsumer(this);
-
- this.queue.deliverAsync();
- this.isStarted = true;
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": started");
- }
-
- public boolean isStarted()
- {
- return isStarted; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public synchronized void stop() throws Exception
- {
- if (!this.isStarted)
- {
- return;
- }
-
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": receive shutdown request");
-
- this.queue.removeConsumer(this);
-
- this.isStarted = false;
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": shutdown");
- }
-
- public String getName()
- {
- return connectorName;
- }
-
- public Filter getFilter()
- {
- return filter;
- }
-
- /* (non-Javadoc)
- * @see org.apache.activemq.core.server.Consumer#getDeliveringMessages()
- */
- @Override
- public List<MessageReference> getDeliveringMessages()
- {
- return Collections.emptyList();
- }
-
- public HandleStatus handle(final MessageReference ref) throws Exception
- {
- if (filter != null && !filter.match(ref.getMessage()))
- {
- return HandleStatus.NO_MATCH;
- }
-
- synchronized (this)
- {
- ref.handled();
-
- ServerMessage message = ref.getMessage();
-
- StatusUpdate status = new StatusUpdate(message.getBodyBuffer().readString());
-
- // set optional property
-
- if (message.containsProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID))
- {
- status.setInReplyToStatusId(message.getLongProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID));
- }
-
- if (message.containsProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE))
- {
- double geolat = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE);
- double geolong = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LONGITUDE);
- status.setLocation(new GeoLocation(geolat, geolong));
- }
-
- if (message.containsProperty(TwitterConstants.KEY_PLACE_ID))
- {
- status.setPlaceId(message.getStringProperty(TwitterConstants.KEY_PLACE_ID));
- }
-
- if (message.containsProperty(TwitterConstants.KEY_DISPLAY_COODINATES))
- {
- status.setDisplayCoordinates(message.getBooleanProperty(TwitterConstants.KEY_DISPLAY_COODINATES));
- }
-
- // send to Twitter
- try
- {
- this.twitter.updateStatus(status);
- }
- catch (TwitterException e)
- {
- if (e.getStatusCode() == 403)
- {
- // duplicated message
- ActiveMQTwitterLogger.LOGGER.error403(connectorName);
- queue.acknowledge(ref);
-
- return HandleStatus.HANDLED;
- }
- else
- {
- throw e;
- }
- }
-
- queue.acknowledge(ref);
- ActiveMQTwitterLogger.LOGGER.debug(connectorName + ": forwarded to twitter: " + message.getMessageID());
- return HandleStatus.HANDLED;
- }
- }
-
- public void proceedDeliver(MessageReference ref)
- {
- // no op
- }
-
- @Override
- public String toManagementString()
- {
- return toString();
- }
-
- @Override
- public void disconnect()
- {
- try
- {
- stop();
- }
- catch (Exception e)
- {
- ActiveMQServerLogger.LOGGER.errorStoppingConnectorService(e, getName());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterBundle.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterBundle.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterBundle.java
deleted file mode 100644
index d6a7718..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterBundle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.twitter;
-
-
-import org.jboss.logging.annotations.MessageBundle;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * 3/12/12
- *
- * Logger Code 18
- *
- * each message id must be 6 digits long starting with 18, the 3rd digit should be 9
- *
- * so 189000 to 189999
- */
-@MessageBundle(projectCode = "AMQ")
-public class ActiveMQTwitterBundle
-{
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterLogger.java
----------------------------------------------------------------------
diff --git a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterLogger.java b/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterLogger.java
deleted file mode 100644
index 9c66407..0000000
--- a/integration/activemq-twitter-integration/src/main/java/org/apache/activemq/twitter/ActiveMQTwitterLogger.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.twitter;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.Cause;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * 3/15/12
- *
- * Logger Code 18
- *
- * each message id must be 6 digits long starting with 18, the 3rd digit donates the level so
- *
- * INF0 1
- * WARN 2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 181000 to 181999
- */
-@MessageLogger(projectCode = "AMQ")
-public interface ActiveMQTwitterLogger extends BasicLogger
-{
- /**
- * The twitter logger.
- */
- ActiveMQTwitterLogger LOGGER = Logger.getMessageLogger(ActiveMQTwitterLogger.class, ActiveMQTwitterLogger.class.getPackage().getName());
-
- @LogMessage(level = Logger.Level.WARN)
- @Message(id = 182001, value = "{0}: HTTP status code = 403: Ignore duplicated message", format = Message.Format.MESSAGE_FORMAT)
- void error403(String connectorName);
-
- @LogMessage(level = Logger.Level.WARN)
- @Message(id = 182002, value = "Error polling Twitter", format = Message.Format.MESSAGE_FORMAT)
- void errorPollingTwitter(@Cause Throwable t);
-}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 580ce49..912fa6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -281,14 +281,6 @@
<artifactId>jboss-logging-spi</artifactId>
<version>2.1.0.GA</version>
</dependency>
- <!--needed to compile twitter support-->
- <dependency>
- <groupId>org.twitter4j</groupId>
- <artifactId>twitter4j-core</artifactId>
- <!-- there is a new version of this JAR but it breaks our usage of it -->
- <version>2.1.2</version>
- </dependency>
- <!---->
<dependency>
<groupId>org.apache.qpid</groupId>
@@ -505,7 +497,6 @@
<module>activemq-service-extensions</module>
<!-- <module>integration/activemq-jboss-as-integration</module> -->
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>tests</module>
@@ -532,7 +523,6 @@
<module>activemq-service-extensions</module>
<module>integration/activemq-jboss-as-integration</module>
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>examples</module>
@@ -559,7 +549,6 @@
<module>activemq-service-extensions</module>
<module>integration/activemq-jboss-as-integration</module>
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>examples</module>
@@ -588,7 +577,6 @@
<module>activemq-service-extensions</module>
<module>integration/activemq-jboss-as-integration</module>
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>tests</module>
@@ -627,7 +615,6 @@
<module>activemq-service-extensions</module>
<module>integration/activemq-jboss-as-integration</module>
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>tests</module>
@@ -662,7 +649,6 @@
<module>activemq-service-extensions</module>
<module>integration/activemq-jboss-as-integration</module>
<module>integration/activemq-spring-integration</module>
- <module>integration/activemq-twitter-integration</module>
<module>integration/activemq-aerogear-integration</module>
<module>integration/activemq-vertx-integration</module>
<module>tests</module>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/tests/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/pom.xml b/tests/integration-tests/pom.xml
index 42a31ba..d09a575 100644
--- a/tests/integration-tests/pom.xml
+++ b/tests/integration-tests/pom.xml
@@ -71,11 +71,6 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
- <artifactId>activemq-twitter-integration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring-integration</artifactId>
<version>${project.version}</version>
</dependency>
@@ -122,10 +117,6 @@
<artifactId>jbosssx</artifactId>
</dependency>
<dependency>
- <groupId>org.twitter4j</groupId>
- <artifactId>twitter4j-core</artifactId>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
[4/4] activemq-6 git commit: merged #30 - Removing twitter integration
Posted by an...@apache.org.
merged #30 - Removing twitter integration
Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/b61747de
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/b61747de
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/b61747de
Branch: refs/heads/master
Commit: b61747de09663bb2b3744b5ecc60a02f0436be4c
Parents: 4e8edab a3afd62
Author: Andy Taylor <an...@gmail.com>
Authored: Wed Dec 3 07:57:43 2014 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed Dec 3 07:57:43 2014 +0000
----------------------------------------------------------------------
.../activemq/rest/ActiveMQRestLogger.java | 3 -
docs/quickstart-guide/zh/about.xml | 67 --
docs/quickstart-guide/zh/download.xml | 70 --
docs/quickstart-guide/zh/examples.xml | 216 -------
.../zh/images/hornetQ_logo_600px.png | Bin 23866 -> 0 bytes
docs/quickstart-guide/zh/installation.xml | 158 -----
docs/quickstart-guide/zh/introduction.xml | 25 -
docs/quickstart-guide/zh/master.xml | 46 --
docs/quickstart-guide/zh/notice.xml | 29 -
docs/quickstart-guide/zh/running.xml | 68 --
examples/core/twitter-connector/pom.xml | 184 ------
examples/core/twitter-connector/readme.html | 96 ---
.../core/example/TwitterConnectorExample.java | 121 ----
.../server0/activemq-configuration.xml | 71 ---
.../src/main/resources/server0/activemq-jms.xml | 19 -
.../main/resources/server0/activemq-users.xml | 7 -
.../activemq-twitter-integration/pom.xml | 44 --
.../integration/twitter/TwitterConstants.java | 99 ---
.../TwitterIncomingConnectorServiceFactory.java | 52 --
.../TwitterOutgoingConnectorServiceFactory.java | 49 --
.../twitter/impl/IncomingTweetsHandler.java | 234 -------
.../twitter/impl/OutgoingTweetsHandler.java | 266 --------
.../activemq/twitter/ActiveMQTwitterBundle.java | 35 -
.../activemq/twitter/ActiveMQTwitterLogger.java | 58 --
pom.xml | 14 -
tests/integration-tests/pom.xml | 9 -
.../tests/integration/twitter/TwitterTest.java | 637 -------------------
27 files changed, 2677 deletions(-)
----------------------------------------------------------------------
[2/4] activemq-6 git commit: ACTIVEMQ6-20 removing twitter integration
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a3afd625/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/twitter/TwitterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/twitter/TwitterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/twitter/TwitterTest.java
deleted file mode 100644
index 4091073..0000000
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/twitter/TwitterTest.java
+++ /dev/null
@@ -1,637 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.tests.integration.twitter;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.activemq.api.core.TransportConfiguration;
-import org.apache.activemq.api.core.client.ClientConsumer;
-import org.apache.activemq.api.core.client.ClientMessage;
-import org.apache.activemq.api.core.client.ClientProducer;
-import org.apache.activemq.api.core.client.ClientSession;
-import org.apache.activemq.api.core.client.ClientSessionFactory;
-import org.apache.activemq.api.core.client.ActiveMQClient;
-import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.core.config.Configuration;
-import org.apache.activemq.core.config.ConnectorServiceConfiguration;
-import org.apache.activemq.core.config.CoreQueueConfiguration;
-import org.apache.activemq.core.server.ConnectorService;
-import org.apache.activemq.core.server.ActiveMQServer;
-import org.apache.activemq.integration.twitter.TwitterConstants;
-import org.apache.activemq.integration.twitter.TwitterIncomingConnectorServiceFactory;
-import org.apache.activemq.integration.twitter.TwitterOutgoingConnectorServiceFactory;
-import org.apache.activemq.tests.integration.IntegrationTestLogger;
-import org.apache.activemq.tests.util.ServiceTestBase;
-import org.apache.activemq.tests.util.UnitTestCase;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import twitter4j.Paging;
-import twitter4j.ResponseList;
-import twitter4j.Status;
-import twitter4j.Twitter;
-import twitter4j.TwitterFactory;
-import twitter4j.http.AccessToken;
-
-/**
- * A TwitterTest
- *
- * @author tm.igarashi@gmail.com
- */
-public class TwitterTest extends ServiceTestBase
-{
- private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER;
- private static final String KEY_CONNECTOR_NAME = "connector.name";
- private static final String KEY_CONSUMER_KEY = "consumerKey";
- private static final String KEY_CONSUMER_SECRET = "consumerSecret";
- private static final String KEY_ACCESS_TOKEN = "accessToken";
- private static final String KEY_ACCESS_TOKEN_SECRET = "accessTokenSecret";
- private static final String KEY_QUEUE_NAME = "queue.name";
-
- private static final String TWITTER_CONSUMER_KEY = System.getProperty("twitter.consumerKey");
- private static final String TWITTER_CONSUMER_SECRET = System.getProperty("twitter.consumerSecret");
- private static final String TWITTER_ACCESS_TOKEN = System.getProperty("twitter.accessToken");
- private static final String TWITTER_ACCESS_TOKEN_SECRET = System.getProperty("twitter.accessTokenSecret");
-
- // incoming
-
- @Override
- @Before
- public void setUp() throws Exception
- {
- super.setUp();
- }
-
- @BeforeClass
- public static void hasCredentials()
- {
- Assume.assumeNotNull(TWITTER_CONSUMER_KEY);
- Assume.assumeFalse("null".equals(TWITTER_CONSUMER_KEY));
- }
-
- @Test
- public void testSimpleIncoming() throws Exception
- {
- internalTestIncoming(true, false);
- }
-
- @Test
- public void testIncomingNoQueue() throws Exception
- {
- internalTestIncoming(false, false);
- }
-
- @Test
- public void testIncomingWithRestart() throws Exception
- {
- internalTestIncoming(true, true);
- }
-
- @Test
- public void testIncomingWithEmptyConnectorName() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_CONNECTOR_NAME, "");
- internalTestIncomingFailedToInitialize(params);
- }
-
- @Test
- public void testIncomingWithEmptyQueueName() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_QUEUE_NAME, "");
- internalTestIncomingFailedToInitialize(params);
- }
-
- @Test
- public void testIncomingWithInvalidCredentials() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_CONSUMER_KEY, "invalidConsumerKey");
- params.put(KEY_CONSUMER_SECRET, "invalidConsumerSecret");
- params.put(KEY_ACCESS_TOKEN, "invalidAccessToken");
- params.put(KEY_ACCESS_TOKEN_SECRET, "invalidAcccessTokenSecret");
- internalTestIncomingFailedToInitialize(params);
- }
-
- //outgoing
-
- @Test
- public void testSimpleOutgoing() throws Exception
- {
- internalTestOutgoing(true, false);
- }
-
- @Test
- public void testOutgoingNoQueue() throws Exception
- {
- internalTestOutgoing(false, false);
- }
-
- @Test
- public void testOutgoingWithRestart() throws Exception
- {
- internalTestOutgoing(true, true);
- }
-
- @Test
- public void testOutgoingWithEmptyConnectorName() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_CONNECTOR_NAME, "");
- internalTestOutgoingFailedToInitialize(params);
- }
-
- @Test
- public void testOutgoingWithEmptyQueueName() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_QUEUE_NAME, "");
- internalTestOutgoingFailedToInitialize(params);
- }
-
- @Test
- public void testOutgoingWithInvalidCredentials() throws Exception
- {
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(KEY_CONSUMER_KEY, "invalidConsumerKey");
- params.put(KEY_CONSUMER_SECRET, "invalidConsumerSecret");
- params.put(KEY_ACCESS_TOKEN, "invalidAccessToken");
- params.put(KEY_ACCESS_TOKEN_SECRET, "invalidAcccessTokenSecret");
- internalTestOutgoingFailedToInitialize(params);
- }
-
- @Test
- public void testOutgoingWithInReplyTo() throws Exception
- {
- internalTestOutgoingWithInReplyTo();
- }
-
- protected void internalTestIncoming(boolean createQueue, boolean restart) throws Exception
- {
- ActiveMQServer server0 = null;
- ClientSession session = null;
- ServerLocator locator = null;
- String queue = "TwitterTestQueue";
- int interval = 5;
- Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(TWITTER_CONSUMER_KEY,
- TWITTER_CONSUMER_SECRET,
- new AccessToken(TWITTER_ACCESS_TOKEN,
- TWITTER_ACCESS_TOKEN_SECRET));
- String testMessage = "TwitterTest/incoming: " + System.currentTimeMillis();
- log.debug("test incoming: " + testMessage);
-
- try
- {
- HashMap<String, Object> config = new HashMap<String, Object>();
- config.put(TwitterConstants.INCOMING_INTERVAL, interval);
- config.put(TwitterConstants.QUEUE_NAME, queue);
- config.put(TwitterConstants.CONSUMER_KEY, TWITTER_CONSUMER_KEY);
- config.put(TwitterConstants.CONSUMER_SECRET, TWITTER_CONSUMER_SECRET);
- config.put(TwitterConstants.ACCESS_TOKEN, TWITTER_ACCESS_TOKEN);
- config.put(TwitterConstants.ACCESS_TOKEN_SECRET, TWITTER_ACCESS_TOKEN_SECRET);
- ConnectorServiceConfiguration inconf = new ConnectorServiceConfiguration()
- .setFactoryClassName(TwitterIncomingConnectorServiceFactory.class.getName())
- .setParams(config)
- .setName("test-incoming-connector");
-
- Configuration configuration = createDefaultConfig(false)
- .addConnectorServiceConfiguration(inconf);
-
- if (createQueue)
- {
- CoreQueueConfiguration qc = new CoreQueueConfiguration()
- .setAddress(queue)
- .setName(queue);
- configuration.getQueueConfigurations().add(qc);
- }
-
- server0 = createServer(false, configuration);
- server0.start();
-
- if (restart)
- {
- server0.getConnectorsService().stop();
- server0.getConnectorsService().start();
- }
-
- assertEquals(1, server0.getConnectorsService().getConnectors().size());
- Iterator<ConnectorService> connectorServiceIterator = server0.getConnectorsService().getConnectors().iterator();
- if (createQueue)
- {
- Assert.assertTrue(connectorServiceIterator.next().isStarted());
- }
- else
- {
- Assert.assertFalse(connectorServiceIterator.next().isStarted());
- return;
- }
-
- twitter.updateStatus(testMessage);
-
- TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
- locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
- ClientSessionFactory sf = createSessionFactory(locator);
- session = sf.createSession(false, true, true);
- ClientConsumer consumer = session.createConsumer(queue);
- session.start();
- ClientMessage msg = consumer.receive(60 * 1000);
-
- Assert.assertNotNull(msg);
- Assert.assertEquals(testMessage, msg.getBodyBuffer().readString());
-
- msg.acknowledge();
- }
- finally
- {
- try
- {
- session.close();
- }
- catch (Throwable t)
- {
- }
-
- try
- {
- locator.close();
- }
- catch (Throwable ignored)
- {
- }
-
- try
- {
- server0.stop();
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-
- protected void internalTestIncomingFailedToInitialize(HashMap<String, String> params) throws Exception
- {
- ActiveMQServer server0 = null;
- String connectorName = "test-incoming-connector";
- String queue = "TwitterTestQueue";
- String consumerKey = "invalidConsumerKey";
- String consumerSecret = "invalidConsumerSecret";
- String accessToken = "invalidAccessToken";
- String accessTokenSecret = "invalidAccessTokenSecret";
- int interval = 5;
-
- if (params.containsKey(KEY_CONNECTOR_NAME))
- {
- connectorName = params.get(KEY_CONNECTOR_NAME);
- }
- if (params.containsKey(KEY_CONSUMER_KEY))
- {
- consumerKey = params.get(KEY_CONSUMER_KEY);
- }
- if (params.containsKey(KEY_CONSUMER_SECRET))
- {
- consumerSecret = params.get(KEY_CONSUMER_SECRET);
- }
- if (params.containsKey(KEY_ACCESS_TOKEN))
- {
- accessToken = params.get(KEY_ACCESS_TOKEN);
- }
- if (params.containsKey(KEY_ACCESS_TOKEN_SECRET))
- {
- accessTokenSecret = params.get(KEY_ACCESS_TOKEN_SECRET);
- }
- if (params.containsKey(KEY_QUEUE_NAME))
- {
- queue = params.get(KEY_QUEUE_NAME);
- }
-
- try
- {
- HashMap<String, Object> config = new HashMap<String, Object>();
- config.put(TwitterConstants.INCOMING_INTERVAL, interval);
- config.put(TwitterConstants.QUEUE_NAME, queue);
- config.put(TwitterConstants.CONSUMER_KEY, consumerKey);
- config.put(TwitterConstants.CONSUMER_SECRET, consumerSecret);
- config.put(TwitterConstants.ACCESS_TOKEN, accessToken);
- config.put(TwitterConstants.ACCESS_TOKEN_SECRET, accessTokenSecret);
-
- ConnectorServiceConfiguration inconf = new ConnectorServiceConfiguration()
- .setFactoryClassName(TwitterIncomingConnectorServiceFactory.class.getName())
- .setParams(config)
- .setName(connectorName);
-
- CoreQueueConfiguration qc = new CoreQueueConfiguration()
- .setAddress(queue)
- .setName(queue);
-
- Configuration configuration = createDefaultConfig(false)
- .addConnectorServiceConfiguration(inconf)
- .addQueueConfiguration(qc);
-
- server0 = createServer(false, configuration);
- server0.start();
-
- Set<ConnectorService> conns = server0.getConnectorsService().getConnectors();
- Assert.assertEquals(1, conns.size());
- Iterator<ConnectorService> it = conns.iterator();
- Assert.assertFalse(it.next().isStarted());
- }
- finally
- {
- try
- {
- server0.stop();
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-
- protected void internalTestOutgoing(boolean createQueue, boolean restart) throws Exception
- {
- ActiveMQServer server0 = null;
- ServerLocator locator = null;
- ClientSession session = null;
- String queue = "TwitterTestQueue";
- Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(TWITTER_CONSUMER_KEY,
- TWITTER_CONSUMER_SECRET,
- new AccessToken(TWITTER_ACCESS_TOKEN,
- TWITTER_ACCESS_TOKEN_SECRET));
- String testMessage = "TwitterTest/outgoing: " + System.currentTimeMillis();
- log.debug("test outgoing: " + testMessage);
-
- try
- {
- HashMap<String, Object> config = new HashMap<String, Object>();
- config.put(TwitterConstants.QUEUE_NAME, queue);
- config.put(TwitterConstants.CONSUMER_KEY, TWITTER_CONSUMER_KEY);
- config.put(TwitterConstants.CONSUMER_SECRET, TWITTER_CONSUMER_SECRET);
- config.put(TwitterConstants.ACCESS_TOKEN, TWITTER_ACCESS_TOKEN);
- config.put(TwitterConstants.ACCESS_TOKEN_SECRET, TWITTER_ACCESS_TOKEN_SECRET);
- ConnectorServiceConfiguration outconf = new ConnectorServiceConfiguration()
- .setFactoryClassName(TwitterOutgoingConnectorServiceFactory.class.getName())
- .setParams(config)
- .setName("test-outgoing-connector");
-
- Configuration configuration = createDefaultConfig(false)
- .addConnectorServiceConfiguration(outconf);
-
- if (createQueue)
- {
- CoreQueueConfiguration qc = new CoreQueueConfiguration()
- .setAddress(queue)
- .setName(queue)
- .setDurable(false);
- configuration.getQueueConfigurations().add(qc);
- }
-
- server0 = createServer(false, configuration);
- server0.start();
-
- if (restart)
- {
- server0.getConnectorsService().stop();
- server0.getConnectorsService().start();
- }
-
- assertEquals(1, server0.getConnectorsService().getConnectors().size());
- Iterator<ConnectorService> connectorServiceIterator = server0.getConnectorsService().getConnectors().iterator();
- if (createQueue)
- {
- Assert.assertTrue(connectorServiceIterator.next().isStarted());
- }
- else
- {
- Assert.assertFalse(connectorServiceIterator.next().isStarted());
- return;
- }
-
- TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
- locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
- ClientSessionFactory sf = createSessionFactory(locator);
- session = sf.createSession(false, true, true);
- ClientProducer producer = session.createProducer(queue);
- ClientMessage msg = session.createMessage(false);
- msg.getBodyBuffer().writeString(testMessage);
- session.start();
- producer.send(msg);
-
- Thread.sleep(3000);
-
- Paging page = new Paging();
- page.setCount(1);
- ResponseList res = twitter.getHomeTimeline(page);
-
- Assert.assertEquals(testMessage, ((Status) (res.get(0))).getText());
- }
- finally
- {
- try
- {
- session.close();
- }
- catch (Throwable t)
- {
- }
-
- try
- {
- locator.close();
- }
- catch (Throwable t)
- {
- }
-
- try
- {
- server0.stop();
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-
- protected void internalTestOutgoingFailedToInitialize(HashMap<String, String> params) throws Exception
- {
- ActiveMQServer server0 = null;
- String connectorName = "test-outgoing-connector";
- String queue = "TwitterTestQueue";
- String consumerKey = TWITTER_CONSUMER_KEY;
- String consumerSecret = TWITTER_CONSUMER_SECRET;
- String accessToken = TWITTER_ACCESS_TOKEN;
- String accessTokenSecret = TWITTER_ACCESS_TOKEN_SECRET;
-
- if (params.containsKey(KEY_CONNECTOR_NAME))
- {
- connectorName = params.get(KEY_CONNECTOR_NAME);
- }
- if (params.containsKey(KEY_CONSUMER_KEY))
- {
- consumerKey = params.get(KEY_CONSUMER_KEY);
- }
- if (params.containsKey(KEY_CONSUMER_SECRET))
- {
- consumerSecret = params.get(KEY_CONSUMER_SECRET);
- }
- if (params.containsKey(KEY_ACCESS_TOKEN))
- {
- accessToken = params.get(KEY_ACCESS_TOKEN);
- }
- if (params.containsKey(KEY_ACCESS_TOKEN_SECRET))
- {
- accessTokenSecret = params.get(KEY_ACCESS_TOKEN_SECRET);
- }
- if (params.containsKey(KEY_QUEUE_NAME))
- {
- queue = params.get(KEY_QUEUE_NAME);
- }
-
- try
- {
- HashMap<String, Object> config = new HashMap<String, Object>();
- config.put(TwitterConstants.QUEUE_NAME, queue);
- config.put(TwitterConstants.CONSUMER_KEY, consumerKey);
- config.put(TwitterConstants.CONSUMER_SECRET, consumerSecret);
- config.put(TwitterConstants.ACCESS_TOKEN, accessToken);
- config.put(TwitterConstants.ACCESS_TOKEN_SECRET, accessTokenSecret);
-
- ConnectorServiceConfiguration outconf = new ConnectorServiceConfiguration()
- .setFactoryClassName(TwitterOutgoingConnectorServiceFactory.class.getName())
- .setParams(config)
- .setName(connectorName);
-
- CoreQueueConfiguration qc = new CoreQueueConfiguration()
- .setAddress(queue)
- .setName(queue)
- .setDurable(false);
-
- Configuration configuration = createDefaultConfig(false)
- .addConnectorServiceConfiguration(outconf)
- .addQueueConfiguration(qc);
-
- server0 = createServer(false, configuration);
- server0.start();
-
- }
- finally
- {
- try
- {
- server0.stop();
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-
- protected void internalTestOutgoingWithInReplyTo() throws Exception
- {
- ActiveMQServer server0 = null;
- ClientSession session = null;
- ServerLocator locator = null;
- String queue = "TwitterTestQueue";
- Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(TWITTER_CONSUMER_KEY,
- TWITTER_CONSUMER_SECRET,
- new AccessToken(TWITTER_ACCESS_TOKEN,
- TWITTER_ACCESS_TOKEN_SECRET));
- String testMessage = "TwitterTest/outgoing with in_reply_to: " + System.currentTimeMillis();
- String replyMessage = "@" + twitter.getScreenName() + " TwitterTest/outgoing reply: " + System.currentTimeMillis();
- try
- {
- HashMap<String, Object> config = new HashMap<String, Object>();
- config.put(TwitterConstants.QUEUE_NAME, queue);
- config.put(TwitterConstants.CONSUMER_KEY, TWITTER_CONSUMER_KEY);
- config.put(TwitterConstants.CONSUMER_SECRET, TWITTER_CONSUMER_SECRET);
- config.put(TwitterConstants.ACCESS_TOKEN, TWITTER_ACCESS_TOKEN);
- config.put(TwitterConstants.ACCESS_TOKEN_SECRET, TWITTER_ACCESS_TOKEN_SECRET);
-
- ConnectorServiceConfiguration outconf = new ConnectorServiceConfiguration()
- .setFactoryClassName(TwitterOutgoingConnectorServiceFactory.class.getName())
- .setParams(config)
- .setName("test-outgoing-with-in-reply-to");
-
- CoreQueueConfiguration qc = new CoreQueueConfiguration()
- .setAddress(queue)
- .setName(queue)
- .setDurable(false);
-
- Configuration configuration = createDefaultConfig(false)
- .addConnectorServiceConfiguration(outconf)
- .addQueueConfiguration(qc);
-
- Status s = twitter.updateStatus(testMessage);
-
- server0 = createServer(false, configuration);
- server0.start();
-
- TransportConfiguration tpconf = new TransportConfiguration(UnitTestCase.INVM_CONNECTOR_FACTORY);
- locator = ActiveMQClient.createServerLocatorWithoutHA(tpconf);
-
- ClientSessionFactory sf = createSessionFactory(locator);
- session = sf.createSession(false, true, true);
- ClientProducer producer = session.createProducer(queue);
- ClientMessage msg = session.createMessage(false);
- msg.getBodyBuffer().writeString(replyMessage);
- msg.putLongProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID, s.getId());
- session.start();
- producer.send(msg);
-
- Thread.sleep(3000);
-
- Paging page = new Paging();
- page.setCount(2);
- ResponseList res = twitter.getHomeTimeline(page);
-
- Assert.assertEquals(testMessage, ((Status) (res.get(1))).getText());
- Assert.assertEquals(-1, ((Status) (res.get(1))).getInReplyToStatusId());
- Assert.assertEquals(replyMessage, ((Status) (res.get(0))).getText());
- Assert.assertEquals(s.getId(), ((Status) (res.get(0))).getInReplyToStatusId());
- }
- finally
- {
- try
- {
- session.close();
- }
- catch (Throwable t)
- {
- }
- try
- {
- locator.close();
- }
- catch (Throwable t)
- {
- }
- try
- {
- server0.stop();
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-}