I have created a Service (using ATL) which sends (non-
transactional) messages to a private queue.
However, some messages are sent in duplicates (usually the
duplicate ones arrive a few minutes later) and quite a few
times the my service crashes.
As per MS KB (http://support.microsoft.com/default.aspx?
scid=kb;en-us;255546) duplicate messages shouldn't be
happening.
The registry values mentioned in the KB above -
RemoveDuplicateSize and RemoveDuplicateCleanup - do not
exist in my registry. Does that mean that duplicate
message removal mechanism is not active? Or does it mean
that it is using the default values (10000 and 30 minutes).
If I am to add these registry values manually, can anyone
tell me the units (seconds/minutes) that I should set
up "RemoveDuplicateCleanup" value with?
Any help will be greatly appreciated.
Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights.
.
"Jean-Marc Gautier" <anon...@discussions.microsoft.com> wrote in message
news:08d201c396fe$b0b16060$a101...@phx.gbl...
The code is reproduced below:
HRESULT SendMsg(
WCHAR *pwszComputerName,
WCHAR *pwszQueueName,
_bstr_t & bstrLabel,
_bstr_t & bstrBody)
{
HRESULT hr = E_FAIL;
WCHAR *pTmpPathName=NULL;
try
{
MQ::IMSMQQueueInfoPtr pInfo("MSMQ.MSMQQueueInfo");
MQ::IMSMQQueuePtr qSend;
MQ::IMSMQMessagePtr pMsg("MSMQ.MSMQMessage");
WCHAR *pFormatName = L"DIRECT=OS:";
int nSize=0;
nSize = wcslen(pFormatName) +
wcslen(pwszComputerName) +
wcslen(pwszQueueName) + 2;
pTmpPathName = new WCHAR [nSize];
if(pTmpPathName)
{
wcscpy(pTmpPathName, pFormatName);
wcscat(pTmpPathName, pwszComputerName);
wcscat(pTmpPathName, L"\\");
wcscat(pTmpPathName, pwszQueueName);
pInfo->FormatName = pTmpPathName;
}
qSend = pInfo->Open(
MQ::MQ_SEND_ACCESS,
MQ::MQ_DENY_NONE);
pMsg->Label = bstrLabel;
pMsg->Body = _variant_t(bstrBody);
//pInfo->Refresh();//REVIEW: is this necessary?
if(0 == pInfo->IsTransactional)
pMsg->Send(qSend,
&variant_t((long)MQ::MQ_NO_TRANSACTION));
else
pMsg->Send(qSend,
&variant_t((long)MQ::MQ_SINGLE_MESSAGE));
qSend->Close();
hr = S_OK;
}
catch(_com_error & comError)
{
hr = comError.Error();
LogError(_T("SendMsg():hr=0x%x"), hr);
}
catch(...)
{
hr = E_FAIL;
LogError(_T("SendMsg():Unknown Exception"));
}
if(pTmpPathName)delete pTmpPathName;
return hr;
Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights.
.
"Jean-Marc Gautier" <anon...@discussions.microsoft.com> wrote in message
news:026501c397ae$593dec80$a001...@phx.gbl...