<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I am unable to attach a streaming listener to a spark streaming job.
Error: no streaming listener attached to the spark application is the error we are observing post accessing streaming statistics API.

Please help us with this issue ASAP. Thanks. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33120#M24204</link>
    <description>&lt;P&gt;&lt;B&gt;Issue&lt;/B&gt;:&lt;/P&gt;&lt;P&gt;After adding the listener jar file in the cluster init script, the listener is working (From what I see in the stdout/log4j logs)&lt;/P&gt;&lt;P&gt;But when I try to hit the &lt;/P&gt;&lt;P&gt;'Content-Type: application/json' &lt;A href="http://host:port/api/v1/applications/app-id/streaming/statistics" alt="http://host:port/api/v1/applications/app-id/streaming/statistics" target="_blank"&gt;http://host:port/api/v1/applications/app-id/streaming/statistics&lt;/A&gt; end point&lt;/P&gt;&lt;P&gt;It is showing&lt;B&gt; no streaming listener attached to spark application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Details:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I have created a jar file with the class file containing below code and have made it available to cluster using below shell script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;cluster init script:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;cp /dbfs/FileStore/jars/my_jar.jar /databricks/jars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;mySparkListener class:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener._&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryProgress&lt;/P&gt;&lt;P&gt;import org.apache.log4j.Logger&lt;/P&gt;&lt;P&gt;import org.joda.time.DateTime&lt;/P&gt;&lt;P&gt;import scala.collection.JavaConverters._&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class mySparkListener extends StreamingQueryListener {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryStarted(queryStarted: QueryStartedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query started: " + &lt;A href="https://queryStarted.id" alt="https://queryStarted.id" target="_blank"&gt;queryStarted.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryTerminated(queryTerminated: QueryTerminatedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query terminated: " + &lt;A href="https://queryTerminated.id" alt="https://queryTerminated.id" target="_blank"&gt;queryTerminated.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryProgress(queryProgress: QueryProgressEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query made progress: " + queryProgress.progress)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val listener = new&amp;nbsp;mySparkListener()&lt;/P&gt;&lt;P&gt;spark.streams.addListener(listener)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Note: I have already added following configs to the cluster&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;spark.sql.streaming.metricsEnabled true&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReplyForward&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 11:42:29 GMT</pubDate>
    <dc:creator>swetha</dc:creator>
    <dc:date>2022-08-30T11:42:29Z</dc:date>
    <item>
      <title>I am unable to attach a streaming listener to a spark streaming job.
Error: no streaming listener attached to the spark application is the error we are observing post accessing streaming statistics API.

Please help us with this issue ASAP. Thanks.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33120#M24204</link>
      <description>&lt;P&gt;&lt;B&gt;Issue&lt;/B&gt;:&lt;/P&gt;&lt;P&gt;After adding the listener jar file in the cluster init script, the listener is working (From what I see in the stdout/log4j logs)&lt;/P&gt;&lt;P&gt;But when I try to hit the &lt;/P&gt;&lt;P&gt;'Content-Type: application/json' &lt;A href="http://host:port/api/v1/applications/app-id/streaming/statistics" alt="http://host:port/api/v1/applications/app-id/streaming/statistics" target="_blank"&gt;http://host:port/api/v1/applications/app-id/streaming/statistics&lt;/A&gt; end point&lt;/P&gt;&lt;P&gt;It is showing&lt;B&gt; no streaming listener attached to spark application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Details:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I have created a jar file with the class file containing below code and have made it available to cluster using below shell script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;cluster init script:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;cp /dbfs/FileStore/jars/my_jar.jar /databricks/jars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;mySparkListener class:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener._&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryProgress&lt;/P&gt;&lt;P&gt;import org.apache.log4j.Logger&lt;/P&gt;&lt;P&gt;import org.joda.time.DateTime&lt;/P&gt;&lt;P&gt;import scala.collection.JavaConverters._&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class mySparkListener extends StreamingQueryListener {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryStarted(queryStarted: QueryStartedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query started: " + &lt;A href="https://queryStarted.id" alt="https://queryStarted.id" target="_blank"&gt;queryStarted.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryTerminated(queryTerminated: QueryTerminatedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query terminated: " + &lt;A href="https://queryTerminated.id" alt="https://queryTerminated.id" target="_blank"&gt;queryTerminated.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryProgress(queryProgress: QueryProgressEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query made progress: " + queryProgress.progress)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val listener = new&amp;nbsp;mySparkListener()&lt;/P&gt;&lt;P&gt;spark.streams.addListener(listener)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Note: I have already added following configs to the cluster&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;spark.sql.streaming.metricsEnabled true&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReplyForward&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 11:42:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33120#M24204</guid>
      <dc:creator>swetha</dc:creator>
      <dc:date>2022-08-30T11:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: I am unable to attach a streaming listener to a spark streaming job.
Error: no streaming listener attached to the spark application is the error we are observing post accessing streaming statistics API.

Please help us with this issue ASAP. Thanks.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33121#M24205</link>
      <description>&lt;P&gt;This might help &lt;A href="https://docs.databricks.com/structured-streaming/stream-monitoring.html" target="test_blank"&gt;https://docs.databricks.com/structured-streaming/stream-monitoring.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 23:51:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33121#M24205</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-09-09T23:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: I am unable to attach a streaming listener to a spark streaming job.
Error: no streaming listener attached to the spark application is the error we are observing post accessing streaming statistics API.

Please help us with this issue ASAP. Thanks.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33122#M24206</link>
      <description>&lt;P&gt;Hi @swetha kadiyala​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 11:05:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/33122#M24206</guid>
      <dc:creator>Vidula</dc:creator>
      <dc:date>2022-09-15T11:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: I am unable to attach a streaming listener to a spark streaming job.
Error: no streaming listene</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/99525#M40011</link>
      <description>&lt;P&gt;Have you found the solution? Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 15:05:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-unable-to-attach-a-streaming-listener-to-a-spark-streaming/m-p/99525#M40011</guid>
      <dc:creator>INJUSTIC</dc:creator>
      <dc:date>2024-11-20T15:05:18Z</dc:date>
    </item>
  </channel>
</rss>

