Kafka first message missing - stream

I am trying to fetch the messages from kafka topic and seeing that if I set the auto.commit.reset policy to "earliest" all the messages are processed properly. But if set to "latest", the first message goes missing and the rest of the messages are processed properly. Can anyone help if I am missing something here?

Assuming the group you are using has not committed any offsets, when setting auto.commit.reset to latest the consumer will only receive new messages, so I'm not exactly sure what you mean by "first message".

Related

Determining forwarded and replied to email messages in Microsoft Graph API

I'm building a .NET Core WEB API that serves as an automation layer over Outlook messages and calendars using the Microsoft Graph SDK. One of the requirements is to identify which messages have been replied to or have been forwarded.
It's not yet clear to me how I can determine whether an email message has been forwarded or replied to when using the results of Graph Explorer "My Mail" sample request.
This answer states that the ConversationId property remains the same (which is indeed the case) and that the only indication is either "FW:" or "RE:" prefixed to the subject. Also in the Message documentation I can't seem to find a proper, reliable way of identifying those.
Can anyone tell me how this can be done?
If your looking at mail in the Inbox and you want to know if they have been acted on by a Mail client (eg Oultook or OWA) then you could use PidTagLastVerbExecuted https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaglastverbexecuted-canonical-property (this is how outlook determines it) eg
https://graph.microsoft.com/v1.0/me/messages?$expand=SingleValueExtendedProperties($filter=(Id%20eq%20'Integer%200x1081'))
If a Message had been replied to you would see a result like
"singleValueExtendedProperties": [
{
"id": "Integer 0x1081",
"value": "102"
}
]
This still isn't 100% reliable so if your doing this for Auditing the only way is using the Tracking Logs (MessageTrace in Office365)
Email, in general, has very weak support for message threading. That said, you might be able to pull this from the internetMessageHeaders collection.
Per RFC5322:
The In-Reply-To: and References: fields are used when creating a
reply to a message. They hold the message identifier of the original
message and the message identifiers of other messages (for example,
in the case of a reply to a message that was itself a reply). The
In-Reply-To: field may be used to identify the message (or
messages) to which the new message is a reply, while the
References: field may be used to identify a "thread" of
conversation.
Note that In-Reply-To is an optional field so it may not always be populated.

How to display an interactive message to a channel with a slash command EXCEPT to the person evoking it?

I created an interactive message that gets called via a slash command which gets distributed to the entire channel. Everything works fine. But I can't for the life of me figure out how to limit the message to the entire channel but to the person evoking it. Right now the message goes to everyone including the person that invoked it. If you've ever used /poll, the poll goes out to everyone but the person who created it.
If anyone knows how to do this, can you point me in the right direction?
The response message from a slash command can be only one of two things:
an ephemeral response, which can be seen by the user who issued the command only
an in_channel response, which can be seen by everyone in the channel
There is no feature or switch so that the response message would not be visible to the issuing user.
You can however build a workaround and manually send every user except the one issuing the command an ephemeral message. Here is an outline of how that would work:
Get the list of users of the channel via conversations.members
Send each user an ephemeral message via chat.postEphemeral
There are some significant caveat to this workaround:
You app needs a lot of additional scopes to be allowed to retrieve the member list and send messages (see documentation of those API methods for details)
There is rate limit of about 1 message per second, so it might take quite some time to send those message to all user depending on how big the group is
your slash command needs to respond with 3 seconds. So you will need to implement some fancy multi-threading to be able to send all those messages.
To make that work in private channels you have to work with an additional bot user
That would get you the result you are asking for, but there are some caveats:

Mqtt - How to differentiate a will and testament message from a regular message

I am using 'paho' client and 'mosquitto' broker.
How do we differentiate between a 'regular' and a 'will' message received. Basically I need to filter out and take a different action on receiving a will message.
Simple answer, you don't. They are just normal messages.
If you need to know they are different either include something in the message payload to differentiate or publish to a different topic.

HL7 Error: MSA|AE|0000000|Field [AccessionNo] is required;

I'm using HL7Soup as my HL7 Client to add a new patient record to no avail. Can anyone help me fix an error I received? I have checked HL7 manual on the net, it didn't help as it is very unreliable.
I sent the following message using the client:
MSH|^~\&|HL7Soup|Instance1|HL7Soup|Instance2|20160928142250|1|ADT^A28|0000000|D|2.5.1|1|2|||||||2
EVN|NW|20160928154802|20160928154805|O|1|20160928154821|1
PID|1984|1984|1984|1-1984|Rey Allan|||||||||||||12345x|||||||5||||||||||||||
PV1|1984|R|||||||||||||||||0||||||||||||||||||||||||||||||00001|ACSN||
And got the following response:
MSH|^~\&|HL7Soup|Instance2|HL7Soup|Instance1|20160928163118|1|ORR^O02|0000000|D|2.5.1|1|2
MSA|AE|0000000|Field [AccessionNo] is required;
I don't know which field it's trying to refer to. I checked the manual it suggests 'Visit Number', I changed it, but still had the error. Help Pls.
Thanks in advance.
I think you try to send an ADT message to a system that is configured to receive order (ORM) messages.
The answer you get is an ORR^O02 (a reply to an order message).
The answer requests an accession number. Those are typically used in order entry not in ADT.
You did provide a visit number (PV1-19): 0
Maybe you use the wrong system or the wrong port?
To connect to a remote system I would recommend that you use a library like HAPI (http://hl7api.sourceforge.net) or something like Apache Camel (http://camel.apache.org/hl7) or Mirth Connect. There are many pitfalls in MLLP (the protocol usually used).

messages not retained in Apollo server

I have a problem by using fusesource code to publish mqtt messages to Apollo server.
I wrote the message publisher with the code like the following
connection.publish(topic, message.getBytes(),QoS.AT_LEAST_ONCE, true);
I also wrote the message consumer which subscribes to the topic. If I started my consumer first and then the publisher, the consumer can obtain all messages correctly. However, if I start the publisher first and then the consumer, the consumer will not receive the messages.
Also, I went into Apollo admin console and I could not find any messages in the queue. (Please see attached screen shot).
What should I do to fix this problem? I could not make my consumer running all the time and I don’t want to lose any messages from the publisher. Should not the broker (Apollo) keep all the messages when the consumers are offline? If yes, how come I could not see it?
This seems a silly question but I am pretty new to MQTT and I do need some help.
I suspect the topic is being auto deleted once there are no producers or consumers attached to the topic. To disable auto delete 'feature', add the following XML element within the virual_host config element in apollo.xml:
<topic auto_delete_after="0"/>
Future versions of apollo will avoid deleting the topic when holds a retained message APLO-319 .
This seems like a bug, since you have marked the messages as retained. However, I do not know how Apollo behaves regarding multiple retained messages on a topic. You may want to raise this on their mailing list.

Resources