get an exception when forward events to downstream riemann and influxdb with async-queue!

82 views
Skip to first unread message

he...@aliyun.com

unread,
Jul 29, 2016, 4:09:32 AM7/29/16
to Riemann Users
Hello,
I had define two function as below:
(defn sendto-riemann
 
"Send events to downstream riemann server"
  []
 
(let [host (or (System/getenv "SEQUENCE_RIEMANN_HOST") "0.0.0.0")
        port
(or (System/getenv "SEQUENCE_RIEMANN_PORT") "5555")]
   
(riemann.streams/batch 100 1/10
      (riemann.config/async-queue! :agg {:queue-size 1000
                                   :core-pool-size 4
                                   :max-pool-size 32}
       
(riemann.streams/forward
          (riemann.client/tcp-client :host host :port (read-string port)))))))

(defn sendto-influxdb
 
"Send events to influxDB"
  []
 
(let [influxdb-creds {
                       
:version :0.9
                        :host (or (System/getenv "INFLUXDB_HOST") "localhost")
                       
:port (or (System/getenv "INFLUXDB_PORT") "8086")
                       
:db (or (System/getenv "INFLUXDB_DB") "riemann")
                       
:username (or (System/getenv "INFLUXDB_USER") "riemann")
                       
:password (or (System/getenv "INFLUXDB_PASSWD") "riemann")}]
   
(riemann.streams/batch 100 1/10
      (riemann.config/async-queue! :agg {:queue-size 1000
                                          :core-pool-size 4
                                          :max-pool-size 32
                                          :keep-alive-time 10000}
       
(riemann.influxdb/influxdb influxdb-creds)))))

Then, I call these functions in different condition:
(tagged "flow"
        (sendto-influxdb))

(tagged "sequence"
        (sendto-riemann))

But I got an exception as below:
clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: won't conj service: #object[riemann.service.ExecutorServiceService 0x3b5a19ed "riemann.service.ExecutorServiceService@3b5a19ed"] would conflict with (#object[riemann.service.ExecutorServiceService 0x15d236fd "riemann.service.ExecutorServiceService@15d236fd"]), compiling:(/Users/projs/riemann/src/fee.clj:56:1)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.lang.RT$3.invoke(RT.java:320)
at riemann.config$include.invokeStatic(config.clj:406)
at riemann.config$include.invoke(config.clj:384)
at riemann.bin$_main.invokeStatic(bin.clj:99)
at riemann.bin$_main.invoke(bin.clj:85)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.AFn.applyTo(AFn.java:144)
at riemann.bin.main(Unknown Source)
Caused by: java.lang.IllegalArgumentException: won't conj service: #object[riemann.service.ExecutorServiceService 0x3b5a19ed "riemann.service.ExecutorServiceService@3b5a19ed"] would conflict with (#object[riemann.service.ExecutorServiceService 0x15d236fd "riemann.service.ExecutorServiceService@15d236fd"])
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
at riemann.core$conj_service.invokeStatic(core.clj:98)
at riemann.core$conj_service.invoke(core.clj:81)
at riemann.core$conj_service.invokeStatic(core.clj:84)
at riemann.core$conj_service.invoke(core.clj:81)
at clojure.lang.Atom.swap(Atom.java:51)
at clojure.core$swap_BANG_.invokeStatic(core.clj:2261)
at clojure.core$swap_BANG_.invoke(core.clj:2253)
at riemann.config$service_BANG_.invokeStatic(config.clj:114)
at riemann.config$service_BANG_.invoke(config.clj:81)
at riemann.config$async_queue_BANG_.invokeStatic(config.clj:260)
at riemann.config$async_queue_BANG_.doInvoke(config.clj:232)
at clojure.lang.RestFn.invoke(RestFn.java:442)
at cheetah.riemann.downstream$sendto_riemann.invokeStatic(downstream.clj:9)
at cheetah.riemann.downstream$sendto_riemann.invoke(downstream.clj:3)
at riemann.config$eval311.invokeStatic(fee.clj:67)
at riemann.config$eval311.invoke(fee.clj:56)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.load(Compiler.java:7379)
... 9 common frames omitted

I don't know why. Anybody can help me? Thank you very much.



Message has been deleted

Aphyr

unread,
Jul 29, 2016, 11:34:38 AM7/29/16
to rieman...@googlegroups.com
On 07/29/2016 03:11 AM, 'he...@aliyun.com' via Riemann Users wrote:
> 在 2016年7月29日星期五 UTC+8下午4:09:32,he...@aliyun.com写道:
>
> Hello,
> I had define two function as below:

Most of your code is in black text on a dark grey background, and I can't read it.

--Kyle

he...@aliyun.com

unread,
Jul 30, 2016, 2:44:21 AM7/30/16
to Riemann Users
Sorry, I will type it again.
I had define two function as below:


在 2016年7月29日星期五 UTC+8下午11:34:38,aphyr写道:

Kyle Kingsbury

unread,
Jul 30, 2016, 10:34:26 AM7/30/16
to rieman...@googlegroups.com

Ah, you've named both async-queue services the same thing: :agg. Riemann is saying it can't run two with the same name at the same time.


--
You received this message because you are subscribed to the Google Groups "Riemann Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to riemann-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

he...@aliyun.com

unread,
Jul 30, 2016, 8:37:48 PM7/30/16
to Riemann Users
Ah, thank you very much.

在 2016年7月30日星期六 UTC+8下午10:34:26,aphyr写道:
Reply all
Reply to author
Forward
0 new messages