??xml version="1.0" encoding="utf-8" standalone="yes"?>体彩云南11选5开奖查询今天http://www.cxosbg.tw/paulwong/archive/2019/07/02/434011.htmlpaulwongpaulwongTue, 02 Jul 2019 03:13:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/07/02/434011.htmlhttp://www.cxosbg.tw/paulwong/comments/434011.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/07/02/434011.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/434011.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/434011.htmlSPRING BATCH L件时Q是按一行一行来d数据Q再按CHUNKSIZE提交到REMOTE操作Q有时要整合当前行和下几行,再决定CHUNKSIZEQ以便相关的数据能在q程同一个PROCESSOR中按序q行处理Q因为相关的数据被拆成几个CHUNK来处理的话,有可能不按序来处理。这样就需要动态调整CHUNKSIZE?br />
参照如下Q?br /> https://stackoverflow.com/questions/37390602/spring-batch-custom-completion-policy-for-dynamic-chunk-size

q结合SingleItemPeekableItemReaderQ装饰者,允许查看下一条数据,真正的操作委托给代理Q?img src ="http://www.cxosbg.tw/paulwong/aggbug/434011.html" width = "1" height = "1" />

paulwong 2019-07-02 11:13 发表评论
]]>
RABBITMQ资源http://www.cxosbg.tw/paulwong/archive/2019/06/28/434001.htmlpaulwongpaulwongFri, 28 Jun 2019 02:24:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/28/434001.htmlhttp://www.cxosbg.tw/paulwong/comments/434001.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/28/434001.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/434001.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/434001.htmlhttps://www.jianshu.com/p/79ca08116d57

Spring Boot 中?RabbitMQ
https://juejin.im/post/59f194e06fb9a0451329ec53






paulwong 2019-06-28 10:24 发表评论
]]>
How to implement JMS ReplyTo using SpringBoothttp://www.cxosbg.tw/paulwong/archive/2019/06/27/433981.htmlpaulwongpaulwongThu, 27 Jun 2019 01:20:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/27/433981.htmlhttp://www.cxosbg.tw/paulwong/comments/433981.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/27/433981.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433981.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433981.html

Request-Response is a message-exchange-pattern. In some cases, a message producer may want the consumers to reply to a message. The JMSReplyTo header indicates which destination, if any, a JMS consumer should reply to. The JMSReplyTo header is set explicitly by the JMS client; its contents will be a javax.jms.Destination object (either Topic or Queue).

In some cases, the JMS client will want the message consumers to reply to a temporary topic or queue set up by the JMS client. When a JMS message consumer receives a message that includes a JMSReplyTo destination, it can reply using that destination. A JMS consumer is not required to send a reply, but in some JMS applications, clients are programmed to do so.

For simplicity, this pattern is typically implemented in a purely synchronous fashion, as in web service calls over HTTP, which holds a connection open and waits until the response is delivered or the timeout period expires. However, request–response may also be implemented asynchronously, with a response being returned at some unknown later time.

For more information, check here.

Now, let’s jump into the code. In Spring, there are 2 ways to implement this (at least I know of).

  1. Using JMSTemplate
  2. Using Spring Integration

For demo purpose, I used ActiveMQ. However, you can implement this in other messaging systems like IBM MQ, Rabbit MQ, Tibco EMS, etc. In this demo, I send an ObjectMessage of type Order and reply with a Shipment object.

Using JMSTemplate

  1. First, we include the required dependencies. Replace the activemq dependency with your messaging system’s jars if not using ActiveMQ

     <dependencies>
         
    <dependency>
             
    <groupId>org.springframework.boot</groupId>
             
    <artifactId>spring-boot-starter-activemq</artifactId>
         
    </dependency>
         
    <dependency>
             
    <groupId>org.apache.activemq.tooling</groupId>
             
    <artifactId>activemq-junit</artifactId>
             
    <version>${activemq.version}</version>
             
    <scope>test</scope>
         
    </dependency>
         
    <dependency>
             
    <groupId>org.springframework.boot</groupId>
             
    <artifactId>spring-boot-starter-test</artifactId>
             
    <scope>test</scope>
         
    </dependency>
     
    </dependencies>
  2. Using the default spring.activemq. properties to configure the application with the ActiveMQ. However, you can do this inside a @Configuration class as well.

     spring:
       activemq:
         broker-url: tcp://localhost:
    61616
         non-blocking-redelivery: true
         packages:
           trust-all: true    
  3. Note in the above configuration spring.activemq.packages.trust-all can be changed to spring.activemq.packages.trusted with the appropriate packages.
  4. Now spring will do it’s magic and inject all the required Beans as usual :) However, in our code, we need to EnableJms

    import org.springframework.context.annotation.Configuration;
     
    import org.springframework.jms.annotation.EnableJms;

     @EnableJms
     @Configuration
     
    public class ActiveMQConfig {

         
    public static final String ORDER_QUEUE = "order-queue";
         
    public static final String ORDER_REPLY_2_QUEUE = "order-reply-2-queue";

     }
  5. First, we will configure the Producer

     @Slf4j
     @Service
     
    public class Producer {

         @Autowired
         JmsMessagingTemplate jmsMessagingTemplate;

         @Autowired
         JmsTemplate jmsTemplate;

         
    public Shipment sendWithReply(Order order) throws JMSException {
             jmsTemplate.setReceiveTimeout(
    1000L);
             jmsMessagingTemplate.setJmsTemplate(jmsTemplate);

             Session session 
    = jmsMessagingTemplate.getConnectionFactory().createConnection()
                     .createSession(
    false, Session.AUTO_ACKNOWLEDGE);

             ObjectMessage objectMessage 
    = session.createObjectMessage(order);

             objectMessage.setJMSCorrelationID(UUID.randomUUID().toString());
             objectMessage.setJMSReplyTo(
    new ActiveMQQueue(ORDER_REPLY_2_QUEUE));
             objectMessage.setJMSCorrelationID(UUID.randomUUID().toString());
             objectMessage.setJMSExpiration(
    1000L);
             objectMessage.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);

             
    return jmsMessagingTemplate.convertSendAndReceive(new ActiveMQQueue(ORDER_QUEUE),
                     objectMessage, Shipment.
    class); //this operation seems to be blocking + sync
         }
     }
  6. Note in the above code that, JmsMessagingTemplate is used instead of JmsTemplatebecause, we are interested in the method convertSendAndReceive. As seen in the method signature, it waits to receive the Shipment object from the consumer.
  7. Next, we can see the Receiver

     @Component
     
    public class Receiver implements SessionAwareMessageListener<Message> {

         @Override
         @JmsListener(destination 
    = ORDER_QUEUE)
         
    public void onMessage(Message message, Session session) throws JMSException {
             Order order 
    = (Order) ((ActiveMQObjectMessage) message).getObject();
             Shipment shipment 
    = new Shipment(order.getId(), UUID.randomUUID().toString());

             
    // done handling the request, now create a response message
             final ObjectMessage responseMessage = new ActiveMQObjectMessage();
             responseMessage.setJMSCorrelationID(message.getJMSCorrelationID());
             responseMessage.setObject(shipment);

             
    // Message sent back to the replyTo address of the income message.
             final MessageProducer producer = session.createProducer(message.getJMSReplyTo());
             producer.send(responseMessage);
         }
     }
  8. Using the javax.jms.Session the javax.jms.MessageProducer is created and used to send the reply message to the JMSReplyTo queue. In real life, this receiver could be a different application altogether.

Using Spring Integration

  1. First, we include the required dependencies in addition to the above dependencies

     <dependency>
       
    <groupId>org.springframework.integration</groupId>
       
    <artifactId>spring-integration-jms</artifactId>
     
    </dependency>
  2. Using the default spring.activemq. properties to configure the application with the ActiveMQ. However, you can do this inside a @Configuration class as well.

     spring:
       activemq
    :
         broker
    -url: tcp://localhost:61616
         non
    -blocking-redelivery: true
         packages
    :
           trust
    -all: true   
  3. Note in the above configuration spring.activemq.packages.trust-all can be changed to spring.activemq.packages.trusted with the appropriate packages.
  4. Next we create the required Beans for the Spring Integration.

     @EnableIntegration
     @IntegrationComponentScan
     @Configuration
     
    public class ActiveMQConfig {

         
    public static final String ORDER_QUEUE = "order-queue";
         
    public static final String ORDER_REPLY_2_QUEUE = "order-reply-2-queue";

         @Bean
         
    public MessageConverter messageConverter() {
             MappingJackson2MessageConverter converter 
    = new MappingJackson2MessageConverter();
             converter.setTargetType(MessageType.TEXT);
             converter.setTypeIdPropertyName(
    "_type");
             
    return converter;
         }

         @Bean
         
    public MessageChannel requests() {
             
    return new DirectChannel();
         }

         @Bean
         @ServiceActivator(inputChannel 
    = "requests")
         
    public JmsOutboundGateway jmsGateway(ActiveMQConnectionFactory activeMQConnectionFactory) {
             JmsOutboundGateway gateway 
    = new JmsOutboundGateway();
             gateway.setConnectionFactory(activeMQConnectionFactory);
             gateway.setRequestDestinationName(ORDER_QUEUE);
             gateway.setReplyDestinationName(ORDER_REPLY_2_QUEUE);
             gateway.setCorrelationKey(
    "JMSCorrelationID");
             gateway.setSendTimeout(
    100L);
             gateway.setReceiveTimeout(
    100L);
             
    return gateway;
         }

         @Autowired
         Receiver receiver;

         @Bean
         
    public DefaultMessageListenerContainer responder(ActiveMQConnectionFactory activeMQConnectionFactory) {
             DefaultMessageListenerContainer container 
    = new DefaultMessageListenerContainer();
             container.setConnectionFactory(activeMQConnectionFactory);
             container.setDestinationName(ORDER_QUEUE);
             MessageListenerAdapter adapter 
    = new MessageListenerAdapter(new Object() {

                 @SuppressWarnings(
    "unused")
                 
    public Shipment handleMessage(Order order) {
                     
    return receiver.receiveMessage(order);
                 }

             });
             container.setMessageListener(adapter);
             
    return container;
         }
     }
  5. Next, we will configure the MessagingGateway

     @MessagingGateway(defaultRequestChannel = "requests")
     
    public interface ClientGateway {
         Shipment sendAndReceive(Order order);
     }
  6. We then Autowire this gateway in our Component class when we want to send and receive the message. A sample is shown below.

     @Slf4j
     @Component
     
    public class Receiver {
         
    public Shipment receiveMessage(@Payload Order order) {
             Shipment shipment 
    = new Shipment(order.getId(), UUID.randomUUID().toString());
             
    return shipment;
         }
     }
  7. Next we configure the Componen to process the Order message. After successful execution, this component will send the Shipment message to the JMSReplyTo queue. In real life, this receiver could be a different application altogether.

For those, who just want to clone the code, head out to aniruthmp/jms

Written on June 5, 2018
https://aniruthmp.github.io/Spring-JMS-request-response/


paulwong 2019-06-27 09:20 发表评论
]]>
ACTIVE MQ高Ҏ?/title><link>http://www.cxosbg.tw/paulwong/archive/2019/06/26/433972.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 26 Jun 2019 06:13:00 GMT</pubDate><guid>http://www.cxosbg.tw/paulwong/archive/2019/06/26/433972.html</guid><wfw:comment>http://www.cxosbg.tw/paulwong/comments/433972.html</wfw:comment><comments>http://www.cxosbg.tw/paulwong/archive/2019/06/26/433972.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/paulwong/comments/commentRss/433972.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/paulwong/services/trackbacks/433972.html</trackback:ping><description><![CDATA[<a href="https://blog.51cto.com/1754966750/category17.html" target="_blank">https://blog.51cto.com/1754966750/category17.html</a><br /><img src ="http://www.cxosbg.tw/paulwong/aggbug/433972.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/paulwong/" target="_blank">paulwong</a> 2019-06-26 14:13 <a href="http://www.cxosbg.tw/paulwong/archive/2019/06/26/433972.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JMS消息消费的顺序?/title><link>http://www.cxosbg.tw/paulwong/archive/2019/06/24/433942.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Mon, 24 Jun 2019 09:42:00 GMT</pubDate><guid>http://www.cxosbg.tw/paulwong/archive/2019/06/24/433942.html</guid><wfw:comment>http://www.cxosbg.tw/paulwong/comments/433942.html</wfw:comment><comments>http://www.cxosbg.tw/paulwong/archive/2019/06/24/433942.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/paulwong/comments/commentRss/433942.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/paulwong/services/trackbacks/433942.html</trackback:ping><description><![CDATA[现有的系l架构都是分布式的。有多个消息的发送者和多个消息的消费者。例如订单创建消息和订单支付消息Q我们需要保证先消费订单创徏消息Q然后消费订单支付消息?br /><br />如何解决MQ消息消费序问题<br /><a href="https://segmentfault.com/a/1190000014512075" target="_blank">https://segmentfault.com/a/1190000014512075</a><br /><br />jms-如何保证消息的顺?br /><a href="https://leokongwq.github.io/2017/01/23/jms-message-order.html" target="_blank">https://leokongwq.github.io/2017/01/23/jms-message-order.html</a><br /><br /><br /><br /><br /><br /><br /><br /><img src ="http://www.cxosbg.tw/paulwong/aggbug/433942.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/paulwong/" target="_blank">paulwong</a> 2019-06-24 17:42 <a href="http://www.cxosbg.tw/paulwong/archive/2019/06/24/433942.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Multiple MongoDB connectors with Spring Boothttp://www.cxosbg.tw/paulwong/archive/2019/06/20/433910.htmlpaulwongpaulwongThu, 20 Jun 2019 07:12:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/20/433910.htmlhttp://www.cxosbg.tw/paulwong/comments/433910.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/20/433910.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433910.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433910.htmlhttp://blog.marcosbarbero.com/multiple-mongodb-connectors-in-spring-boot/



paulwong 2019-06-20 15:12 发表评论
]]>
NFS Server 架設http://www.cxosbg.tw/paulwong/archive/2019/06/18/433884.htmlpaulwongpaulwongTue, 18 Jun 2019 01:08:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/18/433884.htmlhttp://www.cxosbg.tw/paulwong/comments/433884.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/18/433884.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433884.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433884.html
  • 安裝 nfs-utils 套g?pre>
    [root@kvm5 ~]# yum install -y nfs-utils
  • 建立 NFS 分n目錄?pre>
    [root@kvm5 ~]# mkdir /public /protected
  • 修改 NFS 分n目錄?SELinux 檔案 context?pre>
    [root@kvm5 ~]# semanage fcontext -a -t public_content_t "/public(/.*)?"
    [root@kvm5 ~]# semanage fcontext -a -t public_content_t "/protected(/.*)?"
    [root@kvm5 ~]# restorecon -Rv /public /protected
  • 考試時不用自行產?kerberos keytabQ只要依照指定的位置下載Q存攑֜目錄 /etc/ 下,且檔名必須為 krb5.keytab?pre>
    [root@kvm5 ~]# wget http://deyu.wang/kvm5.keytab -O /etc/krb5.keytab 
  • kerberos keytab 的驗證跟時間有關Qserver ?client 都必須校時?pre>
    [root@kvm5 ~]# date
    Sun Jan  7 14:50:04 CST 2018
    [root@kvm5 ~]# chronyc -a makestep
    200 OK
    200 OK
    [root@kvm5 ~]# date
    Mon Nov 20 15:53:22 CST 2017
  • ?/protected 下徏立次目錄 restrictedQ並其擁有者設定為 deyu3Q讓 deyu3 可以寫入資料?pre>
    [root@kvm5 ~]# mkdir -p  /protected/restricted 
    [root@kvm5 ~]# chown deyu3 /protected/restricted 
  • R輯a定?/etc/exportsQ分?/protected ?/public 兩個目錄E域 192.168.122.0/24?pre>
    [root@kvm5 ~]# echo '/protected 192.168.122.0/24(rw,sync,sec=krb5p)' > /etc/exports
    [root@kvm5 ~]# echo '/public 192.168.122.0/24(ro,sync)' >> /etc/exports
    [root@kvm5 ~]# vim /etc/exports
    [root@kvm5 ~]# cat /etc/exports
    /protected 192.168.122.0/24(rw,sync,sec=krb5p)
    /public 192.168.122.0/24(ro,sync)

  • NFS 掛載參數說明如下Q詳細說明請參?man 5 nfs 手冊?ol>
  • rwQread-writeQ可讀寫的Ɗ限Q?/li>
  • roQread-onlyQ唯讀的權限;
  • sec=modeQ安全認證模式;
    1. sec=sys 預設Q用本?UNIX UIDs ?GIDs 進行w䆾認證?/li>
    2. sec=krb5 使用 Kerberos V5 取代本地 UNIX UIDs ?GIDs 進行w䆾認證?/li>
    3. sec=krb5i 使用 Kerberos V5 進行w䆾認證Q資料完整性檢查,以防止數據被改?/li>
    4. sec=krb5p 使用 Kerberos V5 進行w䆾認證Q資料完整性檢查及 NFS 傌加密Q以防止數據被篡改,這是最安全的方式?/li>
  • syncQ資料同步寫入到a憶體與碟當中Q?/li>
    [root@kvm5 ~]# man 5 nfs 
  • a定使用 4.2 版本Q以匯出分n SELinux context。無適合的版?client 端掛載時會出?mount.nfs: Protocol not supported 的訊息?pre>
    [root@kvm5 ~]# vim /etc/sysconfig/nfs  sed -i 's/^\(RPCNFSDARGS=\).*$/\1\"-V 4.2\"/' /etc/sysconfig/nfs 
    [root@kvm5 ~]# grep ^RPCNFSDARGS /etc/sysconfig/nfs  RPCNFSDARGS="-V 4.2" 
  • a定開機啟動 nfs 服務QNFS server 端的服務?nfs-server ?nfs-secure-serverQ本版本只要啟動 nfs-server 同時啟?nfs-secure-serverQ而且使用 tab 鍵也不會出現 nfs-secure-server 服務Q但有些版本則是兩者分開,必須是不是兩E服務都啟動?pre>
    [root@kvm5 ~]# systemctl enable nfs-server.service nfs-secure-server.service 
  • 啟動 nfs 服務
    [root@kvm5 ~]# systemctl start nfs-server.service nfs-secure-server.service 
  • 查看目前啟動?nfs 版本Q因 server 指定使用 4.2Q若出現 -4.2 表示 nfs server 沒有成功啟動?pre>
    [root@kvm5 ~]# cat /proc/fs/nfsd/versions -2 +3 +4 +4.1 +4.2 
  • 要確?nfs-secure-server nfs-server 服務都正帔R作?pre>
    [root@kvm5 ~]# systemctl status nfs-secure-server.service nfs-server.service 
    nfs-secure-server.service - Secure NFS Server
       Loaded
    : loaded (/usr/lib/systemd/system/nfs-secure-server.service; enabled)
       Active
    : active (running) since Mon 2015-09-21 20:04:10 CST; 8s ago
      Process
    : 3075 ExecStart=/usr/sbin/rpc.svcgssd $RPCSVCGSSDARGS (code=exited, status=0/SUCCESS)
     Main PID
    : 3077 (rpc.svcgssd)
       CGroup
    : /system.slice/nfs-secure-server.service
               └─
    3077 /usr/sbin/rpc.svcgssd

    Sep 
    21 20:04:10 kvm5.deyu.wang systemd[1]: Starting Secure NFS Server
    Sep 
    21 20:04:10 kvm5.deyu.wang systemd[1]: Started Secure NFS Server.

    nfs
    -server.service - NFS Server
       Loaded
    : loaded (/usr/lib/systemd/system/nfs-server.service; enabled)
       Active
    : active (exited) since Mon 2015-09-21 20:04:10 CST; 8s ago
      Process
    : 3078 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
      Process
    : 3076 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
      Process
    : 3087 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS)
      Process
    : 3084 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
      Process
    : 3083 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS)
     Main PID
    : 3087 (code=exited, status=0/SUCCESS)
       CGroup
    : /system.slice/nfs-server.service

    Sep 
    21 20:04:10 kvm5.deyu.wang systemd[1]: Starting NFS Server
    Sep 
    21 20:04:10 kvm5.deyu.wang systemd[1]: Started NFS Server.
  • 不論是否 TAB 有沒有出現提C,都同時啟動這兩個服務。CentOS 安裝版本 nfs-utils-1.3.0-8.el7.x86_64 啟動 nfs-secure-server 出現錯誤a息Q請埯 yum downgrade nfs-utils 換成 nfs-utils-1.3.0-0.el7.x86_64 套g?pre>
    [root@kvm5 ~]# rpm -qa | grep nfs-utils
    nfs-utils-1.3.0-8.el7.x86_64
    [root
    @kvm5 ~]# yum downgrade nfs-utils -y
    [root@kvm5 ~]# rpm -qa | grep nfs-utils
    nfs-utils-1.3.0-0.el7.x86_64
  • 再重新啟?nfs 服務Q並查看是否正常運作?pre>
    [root@kvm5 ~]# systemctl restart nfs-server.service nfs-secure-server.service 
  • 輸出所有設定的 nfs 分n目錄?pre>
    [root@kvm5 ~]# exportfs -arv
    exporting 192.168.122.0/24:/public
    exporting 
    192.168.122.0/24:/protected


  • paulwong 2019-06-18 09:08 发表评论
    ]]>
    centos7 mysql数据库安装和配置http://www.cxosbg.tw/paulwong/archive/2019/06/14/433861.htmlpaulwongpaulwongFri, 14 Jun 2019 02:24:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/14/433861.htmlhttp://www.cxosbg.tw/paulwong/comments/433861.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/14/433861.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433861.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433861.htmlhttps://www.cnblogs.com/starof/p/4680083.html

    paulwong 2019-06-14 10:24 发表评论
    ]]>
    SPRING BOOT 打包部v指南http://www.cxosbg.tw/paulwong/archive/2019/06/13/433857.htmlpaulwongpaulwongThu, 13 Jun 2019 07:22:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/13/433857.htmlhttp://www.cxosbg.tw/paulwong/comments/433857.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/13/433857.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433857.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433857.htmlhttps://segmentfault.com/a/1190000017386408

    paulwong 2019-06-13 15:22 发表评论
    ]]>
    Spring batch 的高U特?-监听Q异常处理,事务http://www.cxosbg.tw/paulwong/archive/2019/06/12/433855.htmlpaulwongpaulwongWed, 12 Jun 2019 09:03:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/12/433855.htmlhttp://www.cxosbg.tw/paulwong/comments/433855.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/12/433855.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433855.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433855.htmlhttps://my.oschina.net/u/2600078/blog/909346

    paulwong 2019-06-12 17:03 发表评论
    ]]>
    LINUX安装NFShttp://www.cxosbg.tw/paulwong/archive/2019/06/12/433854.htmlpaulwongpaulwongWed, 12 Jun 2019 07:24:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/12/433854.htmlhttp://www.cxosbg.tw/paulwong/comments/433854.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/12/433854.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433854.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433854.html https://qizhanming.com/blog/2018/08/08/how-to-install-nfs-on-centos-7

    How to fix "mountd: refused mount request: unmatched host"
    https://www.golinuxhub.com/2016/09/how-to-fix-mountd-refused-mount-request.html

    nfs讄固定端口q添加防火墙规则
    https://www.centos.bz/2017/12/nfs%E8%AE%BE%E7%BD%AE%E5%9B%BA%E5%AE%9A%E7%AB%AF%E5%8F%A3%E5%B9%B6%E6%B7%BB%E5%8A%A0%E9%98%B2%E7%81%AB%E5%A2%99%E8%A7%84%E5%88%99/

    a
    NFS Server 架設

    https://dywang.csie.cyut.edu.tw/dywang/rhce7/node60.html

    paulwong 2019-06-12 15:24 发表评论
    ]]>
    zip4jhttp://www.cxosbg.tw/paulwong/archive/2019/06/10/433851.htmlpaulwongpaulwongMon, 10 Jun 2019 08:47:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/10/433851.htmlhttp://www.cxosbg.tw/paulwong/comments/433851.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/10/433851.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433851.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433851.htmlhttps://rensanning.iteye.com/blog/1836727



    paulwong 2019-06-10 16:47 发表评论
    ]]>
    Message Processing With Spring Integrationhttp://www.cxosbg.tw/paulwong/archive/2019/06/05/433840.htmlpaulwongpaulwongWed, 05 Jun 2019 03:08:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/05/433840.htmlhttp://www.cxosbg.tw/paulwong/comments/433840.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/05/433840.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433840.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433840.html
    https://dzone.com/articles/message-processing-spring



    paulwong 2019-06-05 11:08 发表评论
    ]]>
    Spring integration 基本概念http://www.cxosbg.tw/paulwong/archive/2019/06/05/433839.htmlpaulwongpaulwongWed, 05 Jun 2019 02:36:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/06/05/433839.htmlhttp://www.cxosbg.tw/paulwong/comments/433839.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/06/05/433839.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433839.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433839.html

    1.spring integration 's architecture

    主要提供两个功能Q?/p>

    在系l内提供实现轻量U、事仉动交互行为的框架

    在系l间提供一U基于适配器的q_Q以支持灉|的系l间交互

    2.spring integration对于企业集成模式的支?/p>

    2.1MessageQ一个信息的单元Q通常有消息头QheaderQ和消息内容QpayloadQ组?/p>

    2.2Message channelQ消息处理节点之间的q接Q负责将Message从生产者传输到消费者?/p>

        Ҏ消费者的多少Q可分ؓpoint to point和publish-subscribe两种


        Ҏ消息传输方式的不同,分ؓ同步和异步两U?/p>

    2.3Message EndpointQ消息处理节点,消息从节点进入通道Q也是从节点d通道

    几个常见的Message EndPointQ?/p>

    CHANNEL ADAPTERQ用于连接该适配器的特点是单向消息流的,要么是消息通过该适配器进入通道Q要么是消息通过该适配器离开通道


    MESSAGING GATEWAYQ处理的消息和Channel Adapter不同Q不是单向的Q即有进入该节点的消息,也会从该节点发出消息?br />



    SERVICE ACTIVATORQ该节点调用服务来处理输入的消息Qƈ服务返回的数据发送到输出通道。在spring integration中,调用的方法被限定为本地方法调用?br />


    ROUTERQ\由器Q将输入的消息\由到某个输出通道?/p>


    SPLITTERQ将输入的消息拆分成子消?br />


    AGGREGATORQ将输入的多个消息合qؓ一个消?br />


    3.观看书中例子hello-world思?/p>

    试gatewayӞ下面代码向通道names内放入消息worldQ?/p>


    然后service-activator从names通道中获得消息worldQ调用方法sayHelloq回值到lgatewayQ?/p>

    解释Qgateway有一个serviceQinterface的属性,q个属性指向一个interface。当我们用一个接口声明一个gatewayӞspring integration会自动帮我们生成该接口的代理c,q样当我们往gateway发送消息时Qspring integration会通过代理cL消息转发到defaultQrequestQchannel中去



    作者:马国?br /> 链接Qhttps://www.jianshu.com/p/bf1643539f99
    来源Q简?br /> 书著作权归作者所有,M形式的{载都误pM者获得授权ƈ注明出处?/div>

    paulwong 2019-06-05 10:36 发表评论
    ]]>
    如何在SPRING INTEGRATION中用事?/title><link>http://www.cxosbg.tw/paulwong/archive/2019/06/04/433836.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 04 Jun 2019 06:19:00 GMT</pubDate><guid>http://www.cxosbg.tw/paulwong/archive/2019/06/04/433836.html</guid><wfw:comment>http://www.cxosbg.tw/paulwong/comments/433836.html</wfw:comment><comments>http://www.cxosbg.tw/paulwong/archive/2019/06/04/433836.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/paulwong/comments/commentRss/433836.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/paulwong/services/trackbacks/433836.html</trackback:ping><description><![CDATA[<div>File Polling using the Spring Integration DSL</div> <a href="http://porterhead.blogspot.com/2016/07/file-polling-using-spring-integration.html" target="_blank">http://porterhead.blogspot.com/2016/07/file-polling-using-spring-integration.html</a><img src ="http://www.cxosbg.tw/paulwong/aggbug/433836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/paulwong/" target="_blank">paulwong</a> 2019-06-04 14:19 <a href="http://www.cxosbg.tw/paulwong/archive/2019/06/04/433836.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SpringBoot使用MongoDB异常问题http://www.cxosbg.tw/paulwong/archive/2019/05/29/433819.htmlpaulwongpaulwongWed, 29 May 2019 08:58:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/05/29/433819.htmlhttp://www.cxosbg.tw/paulwong/comments/433819.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/05/29/433819.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433819.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433819.htmlhttps://www.cnblogs.com/linzhanfly/p/9674778.html

    paulwong 2019-05-29 16:58 发表评论
    ]]>
    MONGODB去除_class字段http://www.cxosbg.tw/paulwong/archive/2019/05/29/433818.htmlpaulwongpaulwongWed, 29 May 2019 06:18:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/05/29/433818.htmlhttp://www.cxosbg.tw/paulwong/comments/433818.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/05/29/433818.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433818.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433818.html
    MongodbConfiguration.java
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.data.mongodb.MongoDbFactory;
    import org.springframework.data.mongodb.core.convert.DbRefResolver;
    import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
    import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper;
    import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
    import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
     
    @Configuration
    public class AppMongoConfig {
      @Autowired private MongoDbFactory mongoDbFactory;
     
      @Autowired private MongoMappingContext mongoMappingContext;
     
      @Bean
      public MappingMongoConverter mappingMongoConverter() {
     
        DbRefResolver dbRefResolver = new DefaultDbRefResolver(mongoDbFactory);
        MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, mongoMappingContext);
        converter.setTypeMapper(new DefaultMongoTypeMapper(null));
     
        return converter;
      }
    }


    paulwong 2019-05-29 14:18 发表评论
    ]]>
    python操作文g存在的问题解军_?/title><link>http://www.cxosbg.tw/tjyhy590/archive/2019/05/14/433783.html</link><dc:creator>鸉K</dc:creator><author>鸉K</author><pubDate>Tue, 14 May 2019 15:04:00 GMT</pubDate><guid>http://www.cxosbg.tw/tjyhy590/archive/2019/05/14/433783.html</guid><wfw:comment>http://www.cxosbg.tw/tjyhy590/comments/433783.html</wfw:comment><comments>http://www.cxosbg.tw/tjyhy590/archive/2019/05/14/433783.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/tjyhy590/comments/commentRss/433783.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/tjyhy590/services/trackbacks/433783.html</trackback:ping><description><![CDATA[ 1、在学习从文件读取数据中Q写了个CZ代码Q读取不在同一个目录的file.txtQ运行后报这个Python OSError: [Errno 22] Invalid argument:错误Q? Q?Q、首先,在F盘的python_stu中新增了一个file.txtQ同时在F盘的python_stu文g目录底下新增一个file文g夹,里面有个file_reader.py来读取python_stu文g目录底下的file.txtQ代码分别如下: file.txtQ? 试 试2 试3 file_reader.pyQ? with open('F:\python_stu\file.txt') as file_obj: contents = file_obj.read(); print(contents.rstrip()); Q?Q、运行后报错Q? Q?Q、出现这U错误的原因是由于读取不到这个文Ӟ看Traceback报的错误Q最后一行,很明显读取不到file.txtQ前面的F:\\python_stu没错Q后面的名称怎么变了Q还是x0cile.txt? Q?Q、解军_法,可修改上q第一行代码ؓQ? with open('F:\python_stu/file.txt') as file_obj: 或者: with open('F:/python_stu/file.txt') as file_obj: 或者: with open('F://python_stu//file.txt') as file_obj: 又或者: with open('F:\\python_stu\\file.txt') as file_obj: q有一些我׃附上了,上面W一U方式不l一Q最好不要用Q用l一的方式,而且有时候还有注意一些{义字W,比如 \tQ\n也会D报错? <img src ="http://www.cxosbg.tw/tjyhy590/aggbug/433783.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/tjyhy590/" target="_blank">鸉K</a> 2019-05-14 23:04 <a href="http://www.cxosbg.tw/tjyhy590/archive/2019/05/14/433783.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA 8 TIMEhttp://www.cxosbg.tw/paulwong/archive/2019/05/09/433761.htmlpaulwongpaulwongThu, 09 May 2019 02:15:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/05/09/433761.htmlhttp://www.cxosbg.tw/paulwong/comments/433761.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/05/09/433761.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433761.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433761.htmlJava 8新特性(四)Q新的时间和日期APIhttps://lw900925.github.io/java/java8-newtime-api.html
     

    paulwong 2019-05-09 10:15 发表评论
    ]]>
    SPRING BOOT BATCH资源http://www.cxosbg.tw/paulwong/archive/2019/05/07/433753.htmlpaulwongpaulwongTue, 07 May 2019 09:07:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/05/07/433753.htmlhttp://www.cxosbg.tw/paulwong/comments/433753.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/05/07/433753.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433753.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433753.html Spring Boot下Spring Batch入门实例 https://www.jianshu.com/p/305192ea4cb1
     

    SPRING BATCH + QUARTZ
    https://examples.javacodegeeks.com/enterprise-java/spring/batch/quartz-spring-batch-example/
    https://blog.kingbbode.com/posts/spring-batch-quartz

    Spring Batch Tutorial: Batch Processing Made Easy with Spring
    https://www.toptal.com/spring/spring-batch-tutorial

    paulwong 2019-05-07 17:07 发表评论
    ]]>
    以流的方式解释巨大JSON文ghttp://www.cxosbg.tw/paulwong/archive/2019/05/03/433743.htmlpaulwongpaulwongFri, 03 May 2019 07:22:00 GMThttp://www.cxosbg.tw/paulwong/archive/2019/05/03/433743.htmlhttp://www.cxosbg.tw/paulwong/comments/433743.htmlhttp://www.cxosbg.tw/paulwong/archive/2019/05/03/433743.html#Feedback0http://www.cxosbg.tw/paulwong/comments/commentRss/433743.htmlhttp://www.cxosbg.tw/paulwong/services/trackbacks/433743.htmlhttps://www.ngdata.com/parsing-a-large-json-file-efficiently-and-easily/


    https://sites.google.com/site/gson/streaming

    http://www.acuriousanimal.com/2015/10/23/reading-json-file-in-stream-mode-with-gson.html

        public static void main(String [] args) throws IOException {
            String filePath = "C:big-data.json";
            FileInputStream in = new FileInputStream(new File(filePath));
            JsonReader reader = new JsonReader(new InputStreamReader(in, "UTF-8"));
            Gson gson = new GsonBuilder().create();
    //        reader.beginObject();
    //        reader.nextName();
            reader.beginObject();//跌"{"
            while (reader.hasNext()) {
                // Read data into object model
                JsonToken jsonToken = reader.peek();
                if(jsonToken.equals(JsonToken.NAME)) {
                    String name = reader.nextName();
                    if(name.equalsIgnoreCase("SUMMARY")) {
    //                    reader.beginObject();
                        Summary summary = gson.fromJson(reader, Summary.class);
                        logger.info(summary.toString());
                        break;
    //                    reader.endObject();//跌"}"
                    }
                } /*else if(jsonToken.equals(JsonToken.BEGIN_OBJECT)) {
                    reader.beginObject();
                } else if(jsonToken.equals(JsonToken.STRING)) {
                    logger.info(reader.nextString());
                } else if(jsonToken.equals(JsonToken.NUMBER)) {
                    logger.info(reader.nextInt() + "");
                } else if(jsonToken.equals(JsonToken.END_OBJECT)) {
                    reader.endObject();
                } 
    */
    //            Summary summary = gson.fromJson(reader, Summary.class);
    //            break;
            }
            reader.close();
        }


    paulwong 2019-05-03 15:22 发表评论
    ]]>
    微同商城使用U库解决打包~译问题http://www.cxosbg.tw/sdyjmc/archive/2019/04/04/433704.html单飞单飞Thu, 04 Apr 2019 01:36:00 GMThttp://www.cxosbg.tw/sdyjmc/archive/2019/04/04/433704.htmlhttp://www.cxosbg.tw/sdyjmc/comments/433704.htmlhttp://www.cxosbg.tw/sdyjmc/archive/2019/04/04/433704.html#Feedback0http://www.cxosbg.tw/sdyjmc/comments/commentRss/433704.htmlhttp://www.cxosbg.tw/sdyjmc/services/trackbacks/433704.html微同商城 搭徏U服
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
    deploy (default-deploy) on project platform: Failed to deploy artifacts: Could n
    ot find artifact com.platform:platform:pom:1.0.0 in releases(http://nkf:
    8081/repository/xiaowang-host/) -> [Help 1]

        <modelVersion>4.0.0</modelVersion>
        <groupId>com.platform</groupId>
        <artifactId>platform</artifactId>
        <version>1.0.0</version>
        <packaging>pom</packaging>
        <description>platform</description>
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
    deploy (default-deploy) on project platform: Deployment failed: repository eleme
    nt was not specified in the POM inside distributionManagement element or in -Dal
    tDeploymentRepository=id::layout::url parameter -> [Help 1]
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
    deploy (default-deploy) on project platform-mp: Failed to deploy artifacts: Coul
    d not find artifact com.platform:platform-mp:jar:1.0.0 in releases (http:
    //nkf:8081/repository/xiaowang-host/) -> [Help 1]
    搭徏U服
    D:\public\mvn\apache-maven-3.2.2\conf\settings.xml
    <mirror>
            <id>nexus-aliyun</id>
            <mirrorOf>central</mirrorOf>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
    阉K仓库改ؓ中央仓库

    N:\JetBrains\platform\pom.xml

    解决上传W二方jar文g和下载第二方jar文g问题:

    <distributionManagement>
          <repository>
            <id>releases.xiaowang</id>
            <name>Releases</name>
            <url>http://server2:8081/repository/xiaowang-host/</url>
          </repository>
          <snapshotRepository>
            <id>snapshots.xiaowang</id>
            <name>Snapshot</name>
            <url>http://server2:8081/repository/xiaowang-host/</url>
          </snapshotRepository>
        </distributionManagement>
        <repositories>
            <repository>
              <id>releases.xiaowang</id>
              <url>http://server2:8081/repository/xiaowang-host/</url>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </releases>
              <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </snapshots>
            </repository>
        </repositories>


    其它pom.xml文g无需做改?可以用mvn deploy 上传和下载第二方jar文g
    然后使用mvn package 没有问题了?/div>

    单飞 2019-04-04 09:36 发表评论
    ]]> 11ѡ5