Browsing througfh ibm mq messages with a specific date or time or date range - ibm-mq

I am trying to retrieve messages from IBM mq with a specific time range for example messages that were put over the past 2 hours or from 0500 to 0600 or between dates or 2 days back. if possible please provide a sample java code. Thank you

What have you written so far? Or are you looking to pay a consultant to do it for you?
Basically, you have to browse with a lock, and check the message's timestamp to see if it is in the time range, if yes, perform a destructive MQGET otherwise browse the next message.

Related

How can I consume data in a kafka topic after a particular timestamp in spring?

Say my spring consumer program went down I want to consume data from the time it went down. Is there any way to store the timestamp or the offset at that point and continue from there.
Kindly help,
Thanks in advance .
Ensure 3 things:
group-id should be same between restarts
auto.offset.reset should be set as latest
offsets.retention.minutes should be well defined. Read THIS for more details for it.
Kafka-Docs for reference

How to search between messages between two time ranges?

I have a channel in slack, to which a CI tool sends notification. The CI tool sends notification for failure for every operation and there is no way to filter it out. But I know that important notifications come from 12 AM to 2 AM. Is there a way that I can apply a filter daily on that channel between two time intervals ?
Yes. you can call the API method conversations.history, which will return messages from a channel. By settings the parameters oldest and latest accordingly you will only get messages from a specified timeframe.
Note that those parameters are provided as absolute timestamps (e.g. 1234567890.123456), so you need to calculate them for the current day.

Sinch Incoming Message TimeZone

Documentation for Incoming Message Timestamp states that incoming message is stamped with server time.
Unfortunately there is no TimeZone information tagged with the returned value and its difficult to do any sort of operation using the time. Like for example Sinch API replays back all the messages since last 30 days if the App was uninstalled and installed. Because of this reason the incoming message time stamp is very critical as we need to ignore an already replayed message.
Is there a way we can retrieve the TimeZone information of the server so that we can use time zone offset in all our time arithmetic?
We will update the documetation, its UTC time everywhere from us

read messages from JMS MQ or In-Memory Message store by count

I want to read messages from JMS MQ or In-memory message store based on count.
Like I want to start reading the messages when the message count is 10, until that i want the message processor to be idle.
I want this to be done using WSO2 ESB.
Can someone please help me?
Thanks.
I'm not familiar with wso2, but from an MQ perspective, the way to do this would be to trigger the application to run once there are 10 messages on the queue. There are trigger settings for this, specifically TRIGTYPE(DEPTH).
To expand on Morag's answer, I doubt that WS02 has built-in triggers that would monitor the queue for depth before reading messages. I suspect it just listens on a queue and processes messages as they arrive. I also doubt that you can use MQ's triggering mechanism to directly execute the flow conveniently based on depth. So although triggering is a great answer, you need a bit of glue code to make that work.
Conveniently, there's a tutorial that provides almost all the information necessary to do this. Please see Mission:Messaging: Easing administration and debugging with circular queues for details. That article has the scripts necessary to make the Q program work with MQ triggering. You just need to make a couple changes:
Instead of sending a command to Q to delete messages, send a command to move them.
Ditch the math that calculates how many messages to delete and either move them in batches of 10, or else move all messages until the queue drains. In the latter case, make sure to tell Q to wait for any stragglers.
Here's what it looks like when completed: The incoming messages land on some queue other than the WS02 input queue. That queue is triggered based on depth so that the Q program (SupportPac MA01) copies the messages to the real WS02 input queue. After the messages are copied, the glue code resets the trigger. This continues until there are less than 10 messages on the queue, at which time the cycle idles.
I got it by pushing the message to db and get as per the count required as in this answer of me take a look at my answer

Number of messages flowed through queue

I have Queue A. I have used this in one of my message flow which is up and running. I want to know the number of message dropped in to the queue A on particular day or time interval.
Kindly help me in finding out this.
Please have a look at the product manuals, in particular:
Queue statistics information tells how to enable queue statistics and ensure that you are collecting all the relevant data.
Displaying accounting and statistics information which explains, well, pretty much what the title says.
And to keep this on-topic for Stack Overflow, check out the Statistics messages format page which tells you how to programmatically access the queue stats messages. By writing your own code to collect the messages, you can store them to a database, save them off to a file, slice and dice the numbers for pie charts, whatever.
You did not mention which version of MQ that you are using and that is usually important. However, all modern versions of MQ have some queue stats instrumentation. The links I provided are from the v8.0 Knowledge Center.

Resources