   (let [ctx (.errorHandler (Aeron$Context.) no-op-error-handler)
         aeron (Aeron/connect ctx)
         channel (aeron-channel external-addr port)
-        send-pub (.addPublication aeron channel send-stream-id)
-        aux-pub (.addPublication aeron channel aux-stream-id)]
+        f-send-pub #(.addPublication aeron channel send-stream-id)
+        f-aux-pub #(.addPublication aeron channel aux-stream-id)]
     {:conn aeron 
-     :send-pub send-pub 
-     :aux-pub aux-pub}))
+     :send-pub {:f-create f-send-pub
+                :pub (atom nil)} 
+     :aux-pub {:f-create f-aux-pub
+               :pub (atom nil)}}))
 
 (defmethod extensions/receive-messages AeronConnection
   [messenger {:keys [onyx.core/task-map] :as event}]

(defmethod extensions/internal-ack-message AeronConnection
  [messenger event peer-link message-id completion-id ack-val]
  (let [unsafe-buffer (protocol/build-acker-message message-id completion-id ack-val)
        pub ^uk.co.real_logic.aeron.Publication (:aux-pub peer-link)
        offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/ack-msg-length))]
    (while (not (offer-f))
      (.idle ^IdleStrategy (:send-idle-strategy messenger) 0))))

          segments)
        segments))))

(defn get-peer-link-pub [peer-link k]
  (if-let [pub @(get-in peer-link [k :pub])]
    pub
    (reset! (get-in peer-link [k :pub]) ((get-in peer-link [k :f-create])))))

(defmethod extensions/send-messages AeronConnection
  [messenger event peer-link batch]
  (let [[len unsafe-buffer] (protocol/build-messages-msg-buf (:compress-f messenger) batch)
        pub ^uk.co.real_logic.aeron.Publication (get-peer-link-pub peer-link :send-pub)
        offer-f (fn [] (.offer pub unsafe-buffer 0 len))]
    (while (not (offer-f))
      (.idle ^IdleStrategy (:send-idle-strategy messenger) 0))))
