title: how to connect Apache flink to rabbitmq?
body: <p>I get an error when trying to connect Apache Flink to rabbitmq. I did this project with Apache Maven but the error still remains. in this project i use from mvn clean package for compile but i have a error.later i use  from idea compiler but i have error.</p>
  
  <p>my code is :</p>
  
  <pre><code>package org.apache.flink;
  import org.apache.flink.api.common.serialization.SimpleStringSchema;
  import org.apache.flink.streaming.api.datastream.DataStream;
  import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
  import org.apache.flink.streaming.connectors.rabbitmq.RMQSource;
  import org.apache.flink.streaming.connectors.rabbitmq.common.RMQConnectionConfig;
  class App
  {
  public static void main( String[] args )
  {
      final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
      env.enableCheckpointing(10);
      final RMQConnectionConfig connectionConfig = new RMQConnectionConfig.Builder()
              .setHost("local")
              .setPort(5000)
              .build();
      final DataStream&lt;String&gt; stream = env
              .addSource(new RMQSource&lt;String&gt;(
                      connectionConfig,            
                      "queueName",                 
                      true,                        
                      new SimpleStringSchema()))   
              .setParallelism(1);             
  }
  }
  </code></pre>
  
  <p>my pom is :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;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/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
  &lt;artifactId&gt;flink-connector-rabbitmq_2.12&lt;/artifactId&gt;
  &lt;version&gt;1.8.1&lt;/version&gt;
  
  &lt;name&gt;flink-connector-rabbitmq_2.12&lt;/name&gt;
  &lt;!-- FIXME change it to the project's website --&gt;
  &lt;url&gt;http://www.example.com&lt;/url&gt;
  
  &lt;properties&gt;
  &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
  &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;4.11&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-connector-rabbitmq_2.11&lt;/artifactId&gt;
    &lt;version&gt;1.8.1&lt;/version&gt;
  &lt;/dependency&gt;
  
  
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-streaming-java_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;com.rabbitmq&lt;/groupId&gt;
    &lt;artifactId&gt;amqp-client&lt;/artifactId&gt;
    &lt;version&gt;5.7.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-streaming-java_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
    &lt;type&gt;test-jar&lt;/type&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-runtime_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;type&gt;test-jar&lt;/type&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-streaming-java_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;com.rabbitmq&lt;/groupId&gt;
    &lt;artifactId&gt;amqp-client&lt;/artifactId&gt;
    &lt;version&gt;5.7.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-streaming-java_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
    &lt;type&gt;test-jar&lt;/type&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-runtime_2.11&lt;/artifactId&gt;
    &lt;version&gt;${project.version}&lt;/version&gt;
    &lt;type&gt;test-jar&lt;/type&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.flink&lt;/groupId&gt;
    &lt;artifactId&gt;flink-core&lt;/artifactId&gt;
    &lt;version&gt;1.8.1&lt;/version&gt;
  &lt;/dependency&gt;
  
  
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  &lt;pluginManagement&gt;&lt;!-- lock down plugins versions to avoid using Maven    defaults (may be moved to parent pom) --&gt;
    &lt;plugins&gt;
      &lt;!-- clean lifecycle, see https://maven.apache.org/ref/current  /maven-core/lifecycles.html#clean_Lifecycle --&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;!-- default lifecycle, jar packaging: see   https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.0.2&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.8.0&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.22.1&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.0.2&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.5.2&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.8.2&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.7.1&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.0.0&lt;/version&gt;
      &lt;/plugin&gt;
      &lt;/plugins&gt;
     &lt;/plugin Management&gt;
     &lt;/build&gt;
     &lt;/project&gt;
  </code></pre>
  
  <p>When I run the program I encounter the following error</p>
  
  <p>my error is : </p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and  try again
  Exception in thread "main" java.lang.NoClassDefFoundError: org/apache /flink/streaming/api/functions/source/SourceFunction
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
  at java.lang.Class.getMethod0(Class.java:3018)
  at java.lang.Class.getMethod(Class.java:1784)
  at   sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
  at  sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException:   org.apache.flink.streaming.api.functions.source.SourceFunction
  at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 7 more
  </code></pre>
  
  <p>please help me</p>