From users-return-50708-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Sun Nov 18 16:11:38 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 15FF518066C for ; Sun, 18 Nov 2018 16:11:37 +0100 (CET) Received: (qmail 93811 invoked by uid 500); 18 Nov 2018 15:11:36 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 93800 invoked by uid 99); 18 Nov 2018 15:11:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Nov 2018 15:11:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D8224180C69 for ; Sun, 18 Nov 2018 15:11:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.25 X-Spam-Level: ** X-Spam-Status: No, score=2.25 tagged_above=-999 required=6.31 tests=[FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xeNxYndl5bNF for ; Sun, 18 Nov 2018 15:11:34 +0000 (UTC) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 63ED15FBC6 for ; Sun, 18 Nov 2018 15:11:33 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id v5so19565902lfe.7 for ; Sun, 18 Nov 2018 07:11:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Gg0G3CP/0fc1b5ANUF1XiyLWsNuiTTMtu4J8RKdd9g4=; b=UgJdLQfgZZBcEE+ZNE7fB+aSFOOBud87zK4ZhcouI/OwnKvfVE5EX5y8cAySYQeQya ZtQkbtNoiBVBYJxlAhnwhNAFU1aee9DNck7AS/x8zVjoDC5ufOhZ5ibpz/S9GG6MPFgi WAGryXQUwOZeoaqqr57Y9hL6ZMJXbeGW8NjyWK/ItrXGzVq/4Rz4LZ7e5+yk3qtgJBPQ /IiuiAhZS3+b1rxSIj2G/YVg0zUxp9oQe71Okf0m6Y+HoDKyv7LpNgCUAvYNlPWE2+mg EoRIE3QKUfuczQ3/OEE8YQu+U5rg/EigvFB+x6b63u0Y4MrkHYoN3EviKGuRQ+809VbI 3OGQ== X-Gm-Message-State: AGRZ1gJKPdwDJ0FdOP2h9V1YO8Rs0vRzBobz3OJ0zuY82flaAJ1+vpVc soq14W0KQxrhXOrspPEpBMQPUL/8EzOZN7xK7zNFBg== X-Google-Smtp-Source: AJdET5eyw4H3zQ9Rev1baBjRbl7Db8QYA3hwrwPABMeJ3nTMsIqOG/434c1bNyWwMbDL91Vi1oAj7qg8gzPCPtRT9v0= X-Received: by 2002:a19:2a9a:: with SMTP id q26mr8432191lfq.94.1542553892382; Sun, 18 Nov 2018 07:11:32 -0800 (PST) MIME-Version: 1.0 References: <5bed86a23485ab00005a5002@polymail.io> In-Reply-To: <5bed86a23485ab00005a5002@polymail.io> From: Tim Bain Date: Sun, 18 Nov 2018 08:11:19 -0700 Message-ID: Subject: Re: Ack now or too lat - weird behaviour of transaction on ActiveMQ over stomp To: ActiveMQ Users Content-Type: multipart/alternative; boundary="000000000000cd6db5057af1d01b" --000000000000cd6db5057af1d01b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Your pseudocode uses the same message ID for both acks, so the behavior you describe is correct for your pseudocode. Is the pseudocode reflective of your actual code in that respect? Tim On Thu, Nov 15, 2018, 8:37 AM Murphy Meng > I use stomp (1.2) to connect to ActiveMQ (5.15). It is a Python client an= d > stomp.py library is employed. A transaction begins when one message is > received, the client does some processing then acknowledge the message, > then commit the transaction. Such loop starts over when a new message is > received. > > There is a scenario where I found the problem. There could be more then > one messages are received before the transaction begin-process-ack-commit > loop. And such loops handle only one message in one go. What is the issue= ? > The second message received earlier will not be acknowledged at all. > > Pseudo code: > >>class mylistener: > >> def on_message(self, header, body): > >> print(=E2=80=98get message %s=E2=80=99, header[=E2=80=98ack=E2=80= =99]) > >>conn.set_listener(=E2=80=98listener1=E2=80=99, mylistener()); > >>conn.subscribe(destination=3D=E2=80=98queue1', id=3D1, ack=3D=E2=80=98c= lient-individual=E2=80=99) > >>get message ID:03367ac6c23d-44027-1542285031966-10:1 > >>get message ID:03367ac6c23d-44027-1542285031966-10:2 > >>txid1 =3D conn.begin() > >>conn.ack(=E2=80=98ID:03367ac6c23d-44027-1542285031966-10:1=E2=80=99, tx= id1) > >>conn.commit(txid1) > >>txid2 =3D conn.begin() > >>conn.ack(=E2=80=98ID:03367ac6c23d-44027-1542285031966-10:1=E2=80=99, tx= id2) > >>conn.commit(txid2) > > At this point, the second message is not acknowledged at all. You will > find out it stays in the queue and will not be redelivered (if the client > is not disconnected). > > Anyone can tell me is this designed? I don=E2=80=99t see any statement li= ke this > in stomp spec. It looks quite problematic for me. > > Best regards, > > Murphy Meng > Sent from Polymail< > https://polymail.io/?utm_source=3Dpolymail&utm_medium=3Dreferral&utm_camp= aign=3Dsignature > > > > Murphy Meng > API Software Developer > murphy.meng@mirriad.com / > 96 Great Suffolk Street, London, SE1 0BE, GB > > [https://www.mirriad.com/wp-content/uploads/2018/06/Logo.jpg]< > https://www.mirriad.com>[ > https://www.mirriad.com/wp-content/uploads/2018/06/Social_LinkedIn.jpg]< > http://www.linkedin.com/company/mirriad>[ > https://www.mirriad.com/wp-content/uploads/2018/06/Social_Twitter.jpg]< > http://www.twitter.com/mirriad>[ > https://www.mirriad.com/wp-content/uploads/2018/06/Social_Facebook.jpg]< > http://www.facebook.com/mirriad>[ > https://www.mirriad.com/wp-content/uploads/2018/06/Social_Instagram.jpg]< > http://www.instagram.com/mirriad_global> > > Next Gen Advertising Award winner, Content Innovation Awards. > Best Video Marketing & Advertising Platform winner, Digiday Technology > Awards. > Take a look to see what Mirriad In-Video Advertising< > https://player.vimeo.com/external/255397834.hd.mp4?s=3Dfa14d977acd8d1732f= cd6341d22450dc62687e87&profile_id=3D175> > can do for your business. > > This message contains confidential information and is intended only for > the individual(s) addressed in the message. > If you are not the named addressee, you should not disseminate, > distribute, or copy this e-mail. > If you are not the intended recipient, you are notified that disclosing, > distributing, or copying this e-mail is strictly prohibited. > --000000000000cd6db5057af1d01b--