diff --git a/racketmq/hub/local-topic.rkt b/racketmq/hub/local-topic.rkt index 1f6abe0..0b90cc2 100644 --- a/racketmq/hub/local-topic.rkt +++ b/racketmq/hub/local-topic.rkt @@ -86,10 +86,9 @@ (current-content body) (current-content-type content-type) (last-modified-seconds (current-seconds)) - (actor* - (send! (notification self-url - hub-url - self-url - body - content-type)) - (web-respond/status! id 201 #"Created")))))) + (send! (notification self-url + hub-url + self-url + body + content-type)) + (web-respond/status! id 202 #"Accepted"))))) diff --git a/racketmq/hub/remote-topic.rkt b/racketmq/hub/remote-topic.rkt index a9d4482..376677a 100644 --- a/racketmq/hub/remote-topic.rkt +++ b/racketmq/hub/remote-topic.rkt @@ -178,23 +178,22 @@ (on (web-request-incoming (id req) (vh host-name port) 'post ("sub" (,sub-id ())) $body) ;; TODO: verify the use of the shared secret - (actor* - (define parsed-link-headers (parse-link-headers (web-request-header-headers req))) - (define upstream-hub (link-header-ref parsed-link-headers 'hub #f)) - (define upstream-topic (link-header-ref parsed-link-headers 'self #f)) - (define content-type (web-request-header-content-type req)) - (log-info "Remote topic ~a got ~v message ~v; upstream hub ~v, topic ~v" - full-topic - content-type - body - upstream-hub - upstream-topic) - (current-content-hash (sha1 (open-input-bytes body))) - (current-content-type content-type) - (current-upstream-hub upstream-hub) - (send! (notification full-topic - upstream-hub - upstream-topic - body - content-type)) - (web-respond/status! id 201 #"Created")))))) + (define parsed-link-headers (parse-link-headers (web-request-header-headers req))) + (define upstream-hub (link-header-ref parsed-link-headers 'hub #f)) + (define upstream-topic (link-header-ref parsed-link-headers 'self #f)) + (define content-type (web-request-header-content-type req)) + (web-respond/status! id 202 #"Accepted") + (log-info "Remote topic ~a got ~v message ~v; upstream hub ~v, topic ~v" + full-topic + content-type + body + upstream-hub + upstream-topic) + (current-content-hash (sha1 (open-input-bytes body))) + (current-content-type content-type) + (current-upstream-hub upstream-hub) + (send! (notification full-topic + upstream-hub + upstream-topic + body + content-type))))))