     (doseq [{:keys [id completion-id ack-val]} acks] 
       (let [unsafe-buffer (protocol/build-acker-message id completion-id ack-val)
             offer-f (fn [] (.offer pub unsafe-buffer 0 protocol/ack-msg-length))]
-        (while (neg? (offer-f))
+        (while (neg? ^long (offer-f))
           (.idle ^IdleStrategy idle-strategy 0))))))
 
 (defmethod extensions/internal-complete-message AeronConnection

(defmethod extensions/receive-messages AeronConnection
  [messenger {:keys [onyx.core/task-map] :as event}]
  (let [ch (:inbound-ch messenger)
        batch-size (:onyx/batch-size task-map)
        ms (arg-or-default :onyx/batch-timeout task-map)
        timeout-ch (timeout ms)]
    (loop [segments [] i 0]

        idle-strategy (:send-idle-strategy messenger)]
    ;;; TODO: offer will return a particular code when the publisher is down
    ;;; we should probably re-restablish the publication in this case
    (while (neg? ^long (offer-f))
      (.idle ^IdleStrategy idle-strategy 0))))

(defmethod extensions/internal-ack-messages AeronConnection
