title: Celery, RabbitMQ messages keep getting sent
body: <p>Here is the setup - django project with celery and a CloudAMQP rabbitMQ worker doing the message brokering.</p>
  
  <p>My Celery/RabbitMQ settings:</p>
  
  <pre><code># RabbitMQ &amp; Celery settings
  BROKER_URL = 'ampq://guest:guest@localhost:5672/' # Understandably fake
  BROKER_POOL_LIMIT = 1
  BROKER_CONNECTION_TIMEOUT = 30
  BROKER_HEARTBEAT = 30
  CELERY_SEND_EVENTS = False
  CELERY_ACCEPT_CONTENT = ['json']
  CELERY_TASK_SERIALIZER = 'json'
  </code></pre>
  
  <p>A docker container running celery with the following command:</p>
  
  <pre><code>bash -c 'cd django &amp;&amp; celery -A pkm_main worker -E -l info --concurrency=3'
  </code></pre>
  
  <p>The shared_task definition:</p>
  
  <pre><code>from __future__ import absolute_import
  
  from celery import shared_task
  
  @shared_task
  def push_notification(user_id, message):
      logging.critical('Push notifications sent')
      return {'status': 'success'}
  </code></pre>
  
  <p>And me actually calling it when something happens (I have omitted some of the code because it does not seem to be relevant):</p>
  
  <pre><code>from notificatons.tasks import push_notification
  
      def like_this(self, **args):
      # Do like stuff and then do .delay()
      push_notification.delay(media.user.id, request.user.username + ' has liked your item')
  </code></pre>
  
  <p>So when this is ran - everything seems fine and dandy - the output looks like so:</p>
  
  <pre><code>worker_1 | [2016-03-25 09:03:34,888: INFO/MainProcess] Received task: notifications.tasks.push_notification[8443bd88-fa02-4ea4-9bff-8fbec8c91516]
  worker_1 | [2016-03-25 09:03:35,333: CRITICAL/Worker-1] Push notifications sent
  worker_1 | [2016-03-25 09:03:35,336: INFO/MainProcess] Task notifications.tasks.push_notification[8443bd88-fa02-4ea4-9bff-8fbec8c91516] succeeded in 0.444933412999s: {'status': 'success'}
  </code></pre>
  
  <p>So from what I gather the task has been ran and executed properly, the messages should be stopped and RabbitMQ should stop.</p>
  
  <p>But in my RabbitMQ Management I see messages getting published and delivered non-stop:</p>
  
  <p><a href="https://i.stack.imgur.com/ZrW1s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZrW1s.png" alt="RabbitMQ Admin GUI"></a></p>
  
  <p>So what I'm gathering from this is that RabbitMQ is trying to send some sort of confirmation and failing and retrying? Is there a way to actually turn this behavior off? </p>
  
  <p>All help and advice is warmly welcomed.</p>
  
  <p>EDIT: Forgot to mentions something important - until I call on push_notification.delay() the message tab is empty save for the heartbeat that comes and goes every 30 seconds. Only after I have called .delay() does this happen.</p>
  
  <p>EDIT 2: CELERYBEAT_SCHEDULE settings (I've tried running with and without them - there was no difference but adding them just in case)</p>
  
  <pre><code>CELERYBEAT_SCHEDULE = {
      "minutely_process_all_notifications": {
          'task': 'transmissions.tasks.process_all_notifications',
          'schedule': crontab(minute='*')
      }
  }
  </code></pre>
  
  <p>EDIT 3: Added View code. Also I'm not using the CELERYBEAT_SCHEDULE. I'm just keeping the config in the code for future scheduled tasks</p>
  
  <pre><code>from notifications.tasks import push_notification
  
  class MediaLikesView(BaseView):
      def post(self, request, media_id):
          media = self.get_object(media_id)
          data = {}
          data['media'] = media.id
          data['user'] = request.user.id
          serializer = MediaLikeSerializer(data=data)
          if serializer.is_valid():
              like = serializer.save()
              push_notification.delay(media.user.id, request.user.username + ' has liked your item')
              serializer = MediaGetLikeSerializer(like)
              return self.get_mocked_pagination_response(status=status.HTTP_204_NO_CONTENT)
          return self.get_mocked_pagination_response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>