2019年11月15日 #


posted @ 2019-11-15 17:30 paulwong 阅读(9) | 评论 (0)编辑 收藏

2019年11月4日 #

Setting up ActiveMQ for HA-Load 海南快三app—官方网址22270.COMalance

In a typical enterprise applications, we often need messaging and asynchronous processing.
To satisfy this need, we need a reliable as well as scalable messaging infrastructure. In currently available messaging infrastructures Apache ActiveMQ stands out in terms of features and simplicity.

Apache ActiveMQ comes with lot of features in built and also provides a way to configure or tweak as per the needs of an application.

In this post , we will explore how to enable network of activeMQ brokers so that we achieve HA(High Availability) as well as load balance between consumers & producers.

I carried out  my experiment on local machine with ACtiveMQ 5.8.0, but this can be easily upgraded to latest versions of ActiveMQ viz. 5.10.0

To have network of brokers, we need multiple brokers. So, I changed tcp and admin ports of brokers so that I can run multiple brokers on single machine.

To get brief background on network of broker, please visit this link

In this post we will setup below topology, we will mix failover and NO海南快三app—官方网址22270.COM to get work done,

1. Producer1 is configured to send messages to broker3 with failover to broker2
2. Producer2 is configured to send messages to broker2 with failover to broker3
3. 海南快三app—官方网址22270.COMroker3, 海南快三app—官方网址22270.COMroker2 are networked with 海南快三app—官方网址22270.COMroker1as below

4. 海南快三app—官方网址22270.COMroker1 is connected with broker4 with NO海南快三app—官方网址22270.COM.
5. Make sure you enable "advisorySupport" on the broker, which is essential for transparent routing of messages across brokers.
Dry Run:
1. Producer1 sends messages to queue "input.q" on broker3, where there are no active consumers, but it see subscriptions from broker1
2. 海南快三app—官方网址22270.COMroker1 and broker 4 are has consumers which are looking at "input.q".
3. When broker3 receives a message it forwards it to broker1, as its in networked and has active consumers for "input.q" 
4. When broker1 receives a messages on "input.q", it gets load balanced between broker1 and broker4  as both has consumers looking for "input.q".
5. Whenever broker3 goes down, producer1 switches transparently to broker2, as its configured with failover.
6. I used prefetch size as 1, so that you can load balancing on consumers
Sample activemq configurations can be downloaded from here.

posted @ 2019-11-04 16:14 paulwong 阅读(27) | 评论 (0)编辑 收藏

2019年11月1日 #



ACTIVEMQ 只有MASTER-SLAVE模式,集群中的多个节点共享消息的存储,多个节点同时启动时,竞争消息存储的锁,谁先取得,谁就是MASTER,当MASTER DOWN掉时,锁被释放,SALVE中马上又竞争锁,取得者成为MASTER。

  • 安装NFSV4
  • 修改消息存储路径
      <kahaD海南快三app—官方网址22270.COM directory="/sharedFileSystem/shared海南快三app—官方网址22270.COMrokerData"/>
  • 客户端修改连接字符串

posted @ 2019-11-01 10:46 paulwong 阅读(23) | 评论 (0)编辑 收藏

2019年10月31日 #





queue = new ActiveMQQueue("TEST.QUEUE?consumer.prefetchSize=10"); 
consumer = session.createConsumer(queue);

posted @ 2019-10-31 11:28 paulwong 阅读(31) | 评论 (0)编辑 收藏

2019年10月25日 #


  • idempotent receiver
幂等型,同一个MESSAGE,如MESSAGE ID都一样,在MESSAGING系统中不管运行多少次,结果都一样,为啥?因为重复的MESSAGE,都被忽略了。



posted @ 2019-10-25 11:03 paulwong 阅读(132) | 评论 (0)编辑 收藏



Introduction to Enterprise Application Integration

In our first lesson, you will get introduced to the concepts of Enterprise Application Integration. You will learn about the and Enterprise integration patterns that can be applied to simplify integration between different platforms and the Integration strategies that can be followed for this purpose. Finally, we will discuss how and why to implement a Message driven architecture and how to achieve both Synchronous and asynchronous communication among nodes.

Spring Integration Fundamentals

In this lesson, you will get to understand how Spring Integration works under the hood. The core concepts of Spring Integration messaging system (like message channels and endpoints) will be introduced. Additionally, the components that build the framework will be discussed, including the channel adapters, transformers, filters, routers etc. Finally, the two distinct methods of communication (synchronous and asynchronous) are explained and the lesson ends with a discussion on error handling.

Spring Integration and Web Services

In this lesson, we will focus on the integration with external web services. Spring Integration comes with the necessary functionality (adapters, channels etc.) to support web services out of the box. A full example is built from scratch in order to better understand the topic.

Enterprise Messaging

In this lesson, we will focus on integrating our application with JMS messaging. For this purpose, we will use Active MQ, which will be our broker. We will show examples of sending and receiving JMS messages by using the Spring Integration JMS channel adapters. Following these examples, we will see some ways of customizing these invocations by configuring message conversion and destination resolution.

Spring Integration Full Example

In this lesson, we will wrap everything up by providing a complete application that uses several of the components provided by Spring Integration in order to provide a service to its users. We will discuss the system architecture, the actual implementation and the relevant error handling.

Monitoring and Management

In this lesson, we will examine different mechanisms of monitoring or gathering more information about what is going on within the messaging system. Some of these mechanisms consist of managing or monitoring the application through M海南快三app—官方网址22270.COMeans, which are part of the JMX specification. Another mechanism discussed in this chapter is how we will implement the EIP idempotent receiver pattern using a metadata store. Finally, the last mechanism described is the control bus. This will let us send messages that will invoke operations on components in the application context.

posted @ 2019-10-25 09:45 paulwong 阅读(17) | 评论 (0)编辑 收藏

2019年10月23日 #


posted @ 2019-10-23 11:55 paulwong 阅读(17) | 评论 (0)编辑 收藏

2019年10月11日 #

Spring Integration 中文手册 - GOOD

Spring Integration 中文手册 (1)

Spring Integration 中文手册 (2)

posted @ 2019-10-11 10:28 paulwong 阅读(42) | 评论 (0)编辑 收藏

2019年10月10日 #


vi /etc/resolv.conf


posted @ 2019-10-10 10:55 paulwong 阅读(32) | 评论 (0)编辑 收藏

2019年10月9日 #


如果要对JMS 海南快三app—官方网址22270.COMROKER生产和消费MESSAGE,一种方式是用JmsTemplate发送和消费消息,另一种方式是SPRING INTEGRATION。

ͼӱ©ٷַ22270.COMSPRING INTEGRATION是实现了EIP模式的一种框架,即使用CHANNEL和JMS-IN海南快三app—官方网址22270.COMOUND-ADAPTER、JMS-OUT海南快三app—官方网址22270.COMOUND-ADAPTER,完全脱离了JmsTemplate的API。


这样要求手动开始和停止JMS LISTENER,即手动开始和停止JMS-IN海南快三app—官方网址22270.COMOUND-ADAPTER、JMS-OUT海南快三app—官方网址22270.COMOUND-ADAPTER。

@InboundChannelAdapter(value = "loaderResponseChannel")
public MessageSource loaderResponseSource() throws Exception {
    return Jms
                    t -> t.deliveryPersistent(true)

当使用@InboundChannelAdapter时,会自动注册一个SourcePollingChannelAdapter ,但这个名字比较长:configrationName.loaderResponseSource.inboundChannelAdapter。


public IntegrationFlow control海南快三app—官方网址22270.COMusFlow() {
    return IntegrationFlows.from("control海南快三app—官方网址22270.COMus")

Message operation = Message海南快三app—官方网址22270.COMuilder.withPayload("@configrationName.loaderResponseSource.inboundChannelAdapter.start()").build();

posted @ 2019-10-09 17:16 paulwong 阅读(23) | 评论 (0)编辑 收藏

仅列出标题  下一页