1. <nobr id="easjo"><address id="easjo"></address></nobr>

      <track id="easjo"><source id="easjo"></source></track>
      1. 
        

      2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
      3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>
          貴州做網站公司
          貴州做網站公司~專業!靠譜!
          10年網站模板開發經驗,熟悉國內外開源網站程序,包括DEDECMS,WordPress,ZBlog,Discuz! 等網站程序,可為您提供網站建設,網站克隆,仿站,網頁設計,網站制作,網站推廣優化等服務。我們專注高端營銷型網站,企業官網,集團官網,自適應網站,手機網站,網絡營銷,網站優化,網站服務器環境搭建以及托管運維等。為客戶提供一站式網站解決方案?。?!

          Java ServiceActivator類使用實例

          來源:互聯網轉載 時間:2024-01-29 08:28:54

          實例1: messageSender

          import org.springframework.integration.annotation.ServiceActivator; //導入依賴的package包/類@Bean@ServiceActivator(inputChannel = "pubSubOutputChannel")public MessageHandler messageSender(PubSubTemplate pubsubTemplate) {PubSubMessageHandler adapter =new PubSubMessageHandler(pubsubTemplate, "exampleTopic");adapter.setPublishCallback(new ListenableFutureCallback<String>() {@Overridepublic void onFailure(Throwable ex) {LOGGER.info("There was an error sending the message.");}@Overridepublic void onSuccess(String result) {LOGGER.info("Message was sent successfully.");}});return adapter;} 

          實例2: restOutbound

          import org.springframework.integration.annotation.ServiceActivator; //導入依賴的package包/類@ServiceActivator(inputChannel = "outbound-rest", outputChannel = "mark-outboud")public String restOutbound(Message<?> msg) {try {ExportString exportString = (ExportString) msg.getPayload();logger.debug("message arrived at REST outbound sender: " + exportString.getEventId());Addressable addressable = exportString.getRegistration().getAddressable();String uri = addressable.getAddress() + ":" + addressable.getPort() + addressable.getPath();HttpRequestExecutingMessageHandler handler = new HttpRequestExecutingMessageHandler(uri);handler.setHttpMethod(HttpMethod.POST);handler.setExpectReply(false);Message<String> message = MessageBuilder.withPayload(exportString.getEventString()).build();handler.handleMessage(message);logger.info("message sent to REST address:  " + uri + " : " + exportString.getEventId());return exportString.getEventId();} catch (Exception e) {logger.error("Problem with sending message via REST: " + e.getMessage());return null;}} 

          實例3: zmqOutbound

          import org.springframework.integration.annotation.ServiceActivator; //導入依賴的package包/類@ServiceActivator(inputChannel = "outbound-zmq", outputChannel = "mark-outboud")public String zmqOutbound(Message<?> msg) {try {ExportString exportString = (ExportString) msg.getPayload();logger.debug("message arrived at 0MQ outbound sender: " + exportString.getEventId());// today, for ZMQ, subscribers will listen to pre-subscribed EdgeX// ZMQ outbound port.// TODO - someday, reverse the direction and allow clients to set up// inpidual ZMQ port to publish out oflogger.debug(".....sending: " + exportString.getEventString());sendor.sendEventMessage(exportString.getEventString());// logger.error("--->" + exportString.getEventId() + " [email?protected]// " + System.currentTimeMillis());logger.info("message sent via 0MQ " + exportString.getEventId());return exportString.getEventId();} catch (Exception e) {logger.error("Problem with sending message via 0MQ: " + e.getMessage());}return null;} 

          實例4: mqttOutbound

          import org.springframework.integration.annotation.ServiceActivator; //導入依賴的package包/類@ServiceActivator(inputChannel = "outbound-iotcore", outputChannel = "mark-outboud")public String mqttOutbound(Message<?> msg) {try {ExportString payload = (ExportString) msg.getPayload();logger.debug("message arrived at IoT Core MQTT outbound sender: " + payload.getEventId());Addressable addressable = payload.getRegistration().getAddressable();if (addressable != null) {// TODO - cache and reuse clients per clientId// String clientId = addressable.getPublisher();if (sender == null) {sender = new IotCoreMQTTSender(addressable, privateKeyFile, algorithm, 0, 600);}boolean ok = sender.sendMessage(payload.getEventString().getBytes());if (!ok) throw new Exception("error while sending message");logger.info("message sent to IoT Core MQTT broker:  " + payload.getRegistration().getAddressable() + " : " + payload.getEventId());return payload.getEventId();} else {logger.error("No MQTT address information provided with registration.  Event message not sent for client.");}} catch (Exception e) {logger.error("Problem when sending message via MQTT: " + e.getMessage());}return null;} 

          實例5: mqttOutbound

          import org.springframework.integration.annotation.ServiceActivator; //導入依賴的package包/類@ServiceActivator(inputChannel = "outbound-azure", outputChannel = "mark-outboud")public String mqttOutbound(Message<?> msg) {try {ExportString exportString = (ExportString) msg.getPayload();logger.debug("message arrived at Azure MQTT outbound sender: " + exportString.getEventId());Addressable addressable = exportString.getRegistration().getAddressable();if (addressable != null) {// TODO - someday cache and reuse clientsAzureMQTTSender sender = new AzureMQTTSender(exportString.getRegistration().getAddressable(),exportString.getDeviceId());sender.sendMessage(exportString.getEventString().getBytes());logger.info("message sent to Azure MQTT broker:  " + exportString.getRegistration().getAddressable()+ " : " + exportString.getEventId());return exportString.getEventId();} elselogger.error("No MQTT address information provided with registration.  Event message not sent for client.");} catch (Exception e) {logger.error("Problem with sending message via MQTT: " + e.getMessage());}return null;} 
          標簽:activator教程-

          網絡推廣與網站優化公司(網絡優化與推廣專家)作為數字營銷領域的核心服務提供方,其價值在于通過技術手段與策略規劃幫助企業提升線上曝光度、用戶轉化率及品牌影響力。這...

          在當今數字化時代,公司網站已成為企業展示形象、傳遞信息和開展業務的重要平臺。然而,對于許多公司來說,網站建設的價格是一個關鍵考量因素。本文將圍繞“公司網站建設價...

          在當今的數字化時代,企業網站已成為企業展示形象、吸引客戶和開展業務的重要平臺。然而,對于許多中小企業來說,高昂的網站建設費用可能會成為其發展的瓶頸。幸運的是,隨...

          我想知道常熟最便宜的服裝批發市場在哪里,我要具體地點和位置? ;地址在常熟招商城長途汽車站對面的招商場,與常熟招商城長途汽車站門對門。江蘇常熟招商城是最大的服裝批發市場,包括常熟飛越彩虹服裝城、常熟凱萊女裝有限公司;;常熟國際服裝城寫字樓、常熟招商市場、常熟環球服裝城、常熟時裝中心、男裝店穿中心等等。其實你去招商局城隨便問問,一般都知道,關鍵看你想要什么樣的衣服。常熟哪里買大碼女裝?常熟大碼女裝...

          食鹽的保質期一般是多長時間?就食鹽本身而言,沒有保質期,食用鹽可以免于標準保質期。鹽的主要成分是氯化鈉,化學性質穩定,不易變質。醬油是有保質期的。食用鹽的保質期可以免除。如果食鹽中添加了鈣、鐵、鋅、硒等微量元素的鹽,應標注保質期。就鹽本身而言,沒有保質期,只要放在防潮避光的地方就可以了。這是因為鹽的主要成分是氯化鈉,氯化鈉化學性質穩定,一袋300-500克的鹽,幾個月后就會被人吃掉。鹽保質期是多久...

          怎么登錄?登錄的操作步驟如下:1.打開今日頭條瀏覽器。2.然后在瀏覽器的搜索欄輸入“佳緣”,然后點擊搜索。3.然后點擊今日頭條瀏覽器的搜索結果頁面,進入官網首頁,佳緣,然后在上面輸入用戶名和登錄密碼,再點擊“登錄”按鈕。帳號已隱藏,怎樣登錄?我們直接打開佳緣的賬號頁面,點擊進入賬號登錄。突然登不上去了?突然,佳緣無法登錄。也許你的網站沒有連接到互聯網,或者你的手機信號沒有變成4g網絡。這個時候不要...

          TOP
          国产初高中生视频在线观看|亚洲一区中文|久久亚洲欧美国产精品|黄色网站入口免费进人
          1. <nobr id="easjo"><address id="easjo"></address></nobr>

              <track id="easjo"><source id="easjo"></source></track>
              1. 
                

              2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
              3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>