   (ns-resolve 'onyx.messaging.aeron 'aeron-peer-group))
 
 (defmethod messaging-require :netty-tcp [_]
-  (require 'onyx.messaging.netty-tcp))
+  (safe-require 'onyx.messaging.netty-tcp))
 
 (defmethod messenger :netty-tcp [_]
   (ns-resolve 'onyx.messaging.netty-tcp 'netty-tcp-sockets))

(ns ^:no-doc onyx.messaging.common)

(defn my-remote-ip []
  (apply str (butlast (slurp "http://checkip.amazonaws.com"))))


(defmulti messaging-peer-group :onyx.messaging/impl)

(defn safe-require [sym]
  (try (require sym)
       (catch Exception e
         (fatal e
                (str "Error loading messenging."
                     "If your peer is AOT compiled you wiil need to manually require " sym))
         (throw e))))

(defmethod messaging-require :aeron [_]
  (safe-require 'onyx.messaging.aeron))

(defmethod messenger :aeron [_]
  (ns-resolve 'onyx.messaging.aeron 'aeron))
