WSO2 ESB: Handling Retries and Error Codes in Message Processor with Multiple Message Stores

I’m developing an API using WSO2 ESB where I have configured two message stores and a message processor. In the scenario I’m facing, the message processor retries failed messages up to 5 times, but I want to implement a specific behavior:

  • When the message processor encounters client errors (e.g., 400 HTTP
    status code series errors) while calling an endpoint through a proxy
    service, it should move the message directly to the second message
    store without retrying.
  • For other types of errors, the message processor should retry up to 5
    times.

I’ve attempted to achieve this by filtering based on HTTP status codes, directing 4xx series errors to the second message store. And yes, it is adding to the second message store. However, I’m encountering an issue where the message processor is still retrying these messages and not dequeuing from the first/current queue, it should dequeue successfully since I added the message to the second message store. After adding to the second message store I am dropping the message <drop/>.

Message Processor

<?xml version="1.0" encoding="UTF-8"?>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" messageStore="first-store" name="msg-processor" targetEndpoint="ProxyEndpoint" xmlns="http://ws.apache.org/ns/synapse">
    <parameter name="client.retry.interval">5000</parameter>
    <parameter name="member.count">1</parameter>
    <parameter name="message.processor.reply.sequence">reply-sequence</parameter>
    <parameter name="non.retry.status.codes">200</parameter>
    <parameter name="message.processor.deactivate.sequence">deactivate-sequence</parameter>
    <parameter name="is.active">true</parameter>
    <parameter name="max.delivery.attempts">5</parameter>
    <parameter name="message.processor.fault.sequence">fault-sequence</parameter>
    <parameter name="store.connection.retry.interval">1000</parameter>
    <parameter name="max.store.connection.attempts">-1</parameter>
    <parameter name="max.delivery.drop">Disabled</parameter>
    <parameter name="interval">10000</parameter>
</messageProcessor>

Proxy Service

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="ProxyService" startOnLoad="true" transports="http https" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <log level="full"/>
            <enrich>
                <source clone="true" type="body"/>
                <target property="data" type="property"/>
            </enrich>
            <call>
                <endpoint>
                    <http method="post" statistics="enable" trace="enable" uri-template="http://localhost:3001/transfers"></http>
                </endpoint>
            </call>
            <filter regex="200" source="$axis2:HTTP_SC">
                <then>
                    <log level="custom">
                        <property name="text" value="Endpoint Call Success"/>
                    </log>
                </then>
                <else>
                    <filter regex="4[0-9]{2}" source="get-property('axis2', 'HTTP_SC')">
                        <then>
                            <log level="custom">
                                <property name="text" value="Client Error Occurred while Sending Message"/>
                            </log>
                            <store messageStore="second-store"/>
                            <drop/>
                        </then>
                        <else>
                            <log level="custom">
                                <property name="text" value="Other Error Occurred while Sending Message"/>
                            </log>
                        </else>
                    </filter>
                </else>
            </filter>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
</proxy>

Is this happening because the acknowledge is not sending? Should I implement acknowledgment mechanisms, if so how can I do that? Do I need to use class mediators or is there another approach I should consider to achieve this behavior effectively? What should I do or what is I am doing wrong here? Thanks in advance.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật