Migrating Apache Flume Flows to Apache NiFi: JMS To X and X to JMS
Tags: agent, apachenifi, flume, jms
Published: 2019-11-27 17:10:11

---
title: Migrating Apache Flume Flows to Apache NiFi: JMS To X and X to JMS
published: true
date: 2019-10-15 16:57:00 UTC
tags: agent,apache-nifi,flume,jms
canonical_url: 
---

### Migrating Apache Flume Flows to Apache NiFi:  JMS To/From Anywhere

**Article 8 - This - JMS**
 **Article 7 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache\_15.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-any-relational-database-to-from-anywhere-di4-temp-slug-5872947)  

**Article 6 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache\_9.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-kafka-source-to-http-rest-sink-and-http-rest-source-to-kafka-sink-3fce-temp-slug-1034225)

**Article 5 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache\_35.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-syslog-to-kafka-2g4-temp-slug-8252770)

**Article 4 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache\_8.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-twitter-source-to-kafka-sink-2f5o-temp-slug-2494436)

**Article 3 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache\_7.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-kafka-source-to-apache-parquet-on-hdfs-19o3-temp-slug-1137778)

**Article 2 - ** [https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache.html](https://dev.to/tspannhw/migrating-apache-flume-flows-to-apache-nifi-kafka-source-to-hdfs-kudu-file-hive-3iec-temp-slug-5337136)

**Article 1**  - [https://www.datainmotion.dev/2019/08/migrating-apache-flume-flows-to-apache.html](https://www.datainmotion.dev/2019/08/migrating-apache-flume-flows-to-apache.html)

**Source Code:  ** [https://github.com/tspannhw/flume-to-nifi](https://github.com/tspannhw/flume-to-nifi)

  

[![](https://1.bp.blogspot.com/-BVhif2KgNHg/XaX5bvWSXlI/AAAAAAAAYnE/hRa53VHfg2EkqVj9X1G1Hav32kL_f2BsACLcBGAsYHQ/s640/jmstoanywhere.png)](https://1.bp.blogspot.com/-BVhif2KgNHg/XaX5bvWSXlI/AAAAAAAAYnE/hRa53VHfg2EkqVj9X1G1Hav32kL_f2BsACLcBGAsYHQ/s1600/jmstoanywhere.png)
  

This is a simple use case of being a gateway between JMS and other sources and sinks.   We can do a lot more than that in NiFi.  We can be a JMS Consumer or Producer.  All with No Code.  We can work with topics and queues and any message types you have.   We can turn tabular messages (JSON, CSV, XML, AVRO, Parquet, Grokable Text) into Records and process them at speed with queries, updates, merging and fast record processing that is schema aware.  So we know your fields and types and can validate those for you while real-time querying that data as it is sent from and to JMS topics and queues with Apache Calcite SQL.  We can store your schemas in our Cloudera Schema Registry and allow for REST API access to them.   Schemas are accessible from Spark, Flink, Kafka, NiFi and more.  
  
It is extremely easy to do this in NiFi.  
  
In our example we are using Apache ActiveMQ 5.15 as our example JMS Broker.   We are grabbing example data from a few different REST sources and pushing to and from our JMS broker.  
  

[![](https://1.bp.blogspot.com/-_cgImJRSK3g/XaX5fchgHfI/AAAAAAAAYnI/mjKJjkYsHJE3gEswxraijb1YnlX49eSZQCLcBGAsYHQ/s640/anythingtojms.png)](https://1.bp.blogspot.com/-_cgImJRSK3g/XaX5fchgHfI/AAAAAAAAYnI/mjKJjkYsHJE3gEswxraijb1YnlX49eSZQCLcBGAsYHQ/s1600/anythingtojms.png)
  

### Simple NiFi Flow For Pushing JMS Data to KUDU
[![](https://1.bp.blogspot.com/-RhFfPy8AzOI/XaX0G0qcCzI/AAAAAAAAYmY/h5Iz8Z-VVokCI_ZLsyuiw-8kG3SKft1LACLcBGAsYHQ/s640/restToKudu.png)](https://1.bp.blogspot.com/-RhFfPy8AzOI/XaX0G0qcCzI/AAAAAAAAYmY/h5Iz8Z-VVokCI_ZLsyuiw-8kG3SKft1LACLcBGAsYHQ/s1600/restToKudu.png)  

### We can monitor our JMS Activity in Apache ActiveMQ's Web Console

[![](https://1.bp.blogspot.com/-4jVROMY2maw/XaX0CxLw8oI/AAAAAAAAYlY/PwRjAZtIA5Y11RkH5hezPY1E2KeomzTsACLcBGAsYHQ/s640/activeMQconnections.png)](https://1.bp.blogspot.com/-4jVROMY2maw/XaX0CxLw8oI/AAAAAAAAYlY/PwRjAZtIA5Y11RkH5hezPY1E2KeomzTsACLcBGAsYHQ/s1600/activeMQconnections.png)
  

[![](https://1.bp.blogspot.com/-ADKKNmmv0nw/XaX0C6OgWlI/AAAAAAAAYlc/slRh5W5sc70L1BSjMNlrA4FKmkQq_TxSwCLcBGAsYHQ/s640/activemqmessages.png)](https://1.bp.blogspot.com/-ADKKNmmv0nw/XaX0C6OgWlI/AAAAAAAAYlc/slRh5W5sc70L1BSjMNlrA4FKmkQq_TxSwCLcBGAsYHQ/s1600/activemqmessages.png)
  
  

### With Apache NiFi We Ingest All the REST Feeds

[![](https://1.bp.blogspot.com/-p-4_A5fvYMg/XaX0C_buuVI/AAAAAAAAYlg/mTFjzMqISgo-1hBeHaWkk2Xc4EeQupUCgCLcBGAsYHQ/s640/AllFeedsIngestFlow.png)](https://1.bp.blogspot.com/-p-4_A5fvYMg/XaX0C_buuVI/AAAAAAAAYlg/mTFjzMqISgo-1hBeHaWkk2Xc4EeQupUCgCLcBGAsYHQ/s1600/AllFeedsIngestFlow.png)

  

  

  

### These feeds include Coinbase
  

[![](https://1.bp.blogspot.com/-MmvJ3oVx7jc/XaX0DXq8axI/AAAAAAAAYlo/8Dm3yqBKNBUrjzCxRvTCYfpoANzXwCZeQCLcBGAsYHQ/s640/coinbaserest.png)](https://1.bp.blogspot.com/-MmvJ3oVx7jc/XaX0DXq8axI/AAAAAAAAYlo/8Dm3yqBKNBUrjzCxRvTCYfpoANzXwCZeQCLcBGAsYHQ/s1600/coinbaserest.png)

  

  

### NYC Demographics and Live Subway GTFS Data
  

[![](https://1.bp.blogspot.com/-KYkkxo9vrBc/XaX0FO2celI/AAAAAAAAYmE/fXV0kn_CA3Y27akRtgJULDBcAgCYu-UyACLcBGAsYHQ/s640/nycrest2.png)](https://1.bp.blogspot.com/-KYkkxo9vrBc/XaX0FO2celI/AAAAAAAAYmE/fXV0kn_CA3Y27akRtgJULDBcAgCYu-UyACLcBGAsYHQ/s1600/nycrest2.png)

  

**Transit Land Feeds and Operators**

  

[![](https://1.bp.blogspot.com/-7VN7F38ioM8/XaX0HVE-MeI/AAAAAAAAYmc/Y2L8XW70UxQmXDpDW7twBOMlVmhIrrgDACLcBGAsYHQ/s640/transitland.png)](https://1.bp.blogspot.com/-7VN7F38ioM8/XaX0HVE-MeI/AAAAAAAAYmc/Y2L8XW70UxQmXDpDW7twBOMlVmhIrrgDACLcBGAsYHQ/s1600/transitland.png)

  

### World Trading Data
  

[![](https://1.bp.blogspot.com/-cNQyqlSKSyM/XaX0H1GtpuI/AAAAAAAAYmg/tTX3NdxBI1osfN8Jzfcwjzm8ap96trprQCLcBGAsYHQ/s640/worldtradingdata.png)](https://1.bp.blogspot.com/-cNQyqlSKSyM/XaX0H1GtpuI/AAAAAAAAYmg/tTX3NdxBI1osfN8Jzfcwjzm8ap96trprQCLcBGAsYHQ/s1600/worldtradingdata.png)
  

### 'Quandl REST Data

[![](https://1.bp.blogspot.com/-lhA8ANJ4spA/XaX0Ga4sgHI/AAAAAAAAYmU/Bac65WrQassIc74CpsrVIIJAATY9roleQCLcBGAsYHQ/s640/quandlrest.png)](https://1.bp.blogspot.com/-lhA8ANJ4spA/XaX0Ga4sgHI/AAAAAAAAYmU/Bac65WrQassIc74CpsrVIIJAATY9roleQCLcBGAsYHQ/s1600/quandlrest.png)

  

### It is easy to Consume JMS messages from Topics or Queues

[![](https://1.bp.blogspot.com/-l6AKomCdZBI/XaX0DuQM8TI/AAAAAAAAYls/x5m_JJZJ0g4r0CIVkB4YShJ8XKY2H3IOACLcBGAsYHQ/s640/consumeJMS.png)](https://1.bp.blogspot.com/-l6AKomCdZBI/XaX0DuQM8TI/AAAAAAAAYls/x5m_JJZJ0g4r0CIVkB4YShJ8XKY2H3IOACLcBGAsYHQ/s1600/consumeJMS.png)

  

### Consuming Messages in a snap, We just need to set our Connection Factory Service, Destination and Topic/Queue.
  

[![](https://1.bp.blogspot.com/-lbn4HBk-aEY/XaX0D3LCIlI/AAAAAAAAYlw/7H_vJo9VgAo_QAL2iHHFtyT5_xnfxU7SQCLcBGAsYHQ/s640/consumejmstopic.png)](https://1.bp.blogspot.com/-lbn4HBk-aEY/XaX0D3LCIlI/AAAAAAAAYlw/7H_vJo9VgAo_QAL2iHHFtyT5_xnfxU7SQCLcBGAsYHQ/s1600/consumejmstopic.png)

  

  

###  JMS Connection Factory Settings, Just a Java Class, JAR path and Broker URI.   Yes we support SSL!

[![](https://1.bp.blogspot.com/-80tUZiUSepo/XaX0ED62UdI/AAAAAAAAYl0/nI--6aq91oEBzJj78YN5ygI7TY7fochLgCLcBGAsYHQ/s640/jmsConnectionPool.png)](https://1.bp.blogspot.com/-80tUZiUSepo/XaX0ED62UdI/AAAAAAAAYl0/nI--6aq91oEBzJj78YN5ygI7TY7fochLgCLcBGAsYHQ/s1600/jmsConnectionPool.png)
  

### For JMS Queues, pick QUEUE and your QUEUE Name

[![](https://1.bp.blogspot.com/-Nrcj6y8RO4E/XaX0ETA9J4I/AAAAAAAAYl4/Px1bTg-vdighECovf9gc_EAFIl9nMmIigCLcBGAsYHQ/s640/jmsqueuesend.png)](https://1.bp.blogspot.com/-Nrcj6y8RO4E/XaX0ETA9J4I/AAAAAAAAYl4/Px1bTg-vdighECovf9gc_EAFIl9nMmIigCLcBGAsYHQ/s1600/jmsqueuesend.png)

  

### Example JMS MetaData Produced including Delivery Mode, Expiration and Message ID
  

[![](https://1.bp.blogspot.com/-JDLfcyoCQQc/XaX0EsnWU8I/AAAAAAAAYl8/XA91ImUojewM-LZ4ML91yiaKL9aDwvVcwCLcBGAsYHQ/s640/jmstopicrece.png)](https://1.bp.blogspot.com/-JDLfcyoCQQc/XaX0EsnWU8I/AAAAAAAAYl8/XA91ImUojewM-LZ4ML91yiaKL9aDwvVcwCLcBGAsYHQ/s1600/jmstopicrece.png)
  

  

###  Consume From a QUEUE

[![](https://1.bp.blogspot.com/-xAIhQ-uI9es/XaX0Ff4E-4I/AAAAAAAAYmI/9Tbc_R-oFjgYJuJLJz_FxPmCfJTd2dm7ACLcBGAsYHQ/s640/publishJMSQueue.png)](https://1.bp.blogspot.com/-xAIhQ-uI9es/XaX0Ff4E-4I/AAAAAAAAYmI/9Tbc_R-oFjgYJuJLJz_FxPmCfJTd2dm7ACLcBGAsYHQ/s1600/publishJMSQueue.png)

  

### Consume From A TOPIC
  

[![](https://1.bp.blogspot.com/-6PTNE9LVI2Q/XaX0Fie5DQI/AAAAAAAAYmM/k9cabS51ugcl33y3uxrPnGeT1GeyNXtKwCLcBGAsYHQ/s640/publishJMSTopic.png)](https://1.bp.blogspot.com/-6PTNE9LVI2Q/XaX0Fie5DQI/AAAAAAAAYmM/k9cabS51ugcl33y3uxrPnGeT1GeyNXtKwCLcBGAsYHQ/s1600/publishJMSTopic.png)

  

### Let's Push Any and All REST Feed to JMS Topics and Queues
  

[![](https://1.bp.blogspot.com/-1l87QNIgkzQ/XaX0F6HnMhI/AAAAAAAAYmQ/IkQsFlT_lw4hTviid_K7SWtOvTrlp_dCgCLcBGAsYHQ/s640/publishToJMS.png)](https://1.bp.blogspot.com/-1l87QNIgkzQ/XaX0F6HnMhI/AAAAAAAAYmQ/IkQsFlT_lw4hTviid_K7SWtOvTrlp_dCgCLcBGAsYHQ/s1600/publishToJMS.png)
  

  

  

  

  

  

  
  

### 

### References

- [https://dzone.com/articles/ingesting-jms-messages-from-tibco-with-apache-nifi](https://dzone.com/articles/ingesting-jms-messages-from-tibco-with-apache-nifi)
- [https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-jms-processors-nar/1.9.2/org.apache.nifi.jms.processors.PublishJMS/](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-jms-processors-nar/1.9.2/org.apache.nifi.jms.processors.PublishJMS/)
- [https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-jms-processors-nar/1.9.2/org.apache.nifi.jms.processors.ConsumeJMS/](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-jms-processors-nar/1.9.2/org.apache.nifi.jms.processors.ConsumeJMS/)
- [https://community.cloudera.com/t5/Community-Articles/Publishing-and-Consuming-JMS-Messages-from-Tibco-Enterprise/ta-p/248157](https://community.cloudera.com/t5/Community-Articles/Publishing-and-Consuming-JMS-Messages-from-Tibco-Enterprise/ta-p/248157)
- [https://docs.solace.com/Developer-Tools/Integration-Guides/Nifi.htm](https://docs.solace.com/Developer-Tools/Integration-Guides/Nifi.htm)
- [https://community.cloudera.com/t5/Community-Articles/Ingesting-and-Testing-JMS-Data-with-NiFi-into-Hive/ta-p/245848](https://community.cloudera.com/t5/Community-Articles/Ingesting-and-Testing-JMS-Data-with-NiFi-into-Hive/ta-p/245848)
- [https://www.senia.org/2018/05/10/integrating-apache-nifi-with-ibm-mq/](https://www.senia.org/2018/05/10/integrating-apache-nifi-with-ibm-mq/)