IBM WebSphere MQ Triggering issue - triggers

I'm trying to achieve following scenario
When a new message arrives to queue manager it should automatically trigger my console application. Then it will fetch that message and write the message in to a file. I already completed this part. But I'm having problem with triggering message queue
Here is how I configured my message queue
I created two queues one is called LocalQueue and other one is InitQueue which is SYSTEM.DEFAULT.INITIATION.QUEUE.
and set "Trigger" properties in my LocalQueue
Then Created trigger monitor
In process definition object I set my console application path
So my problem is, It doesn't work as it expect and I checked my client machine
C:\Program Files (x86)\IBM\WebSphere MQ\errors\AMQERR01.LOG and server machine C:\Program Files (x86)\IBM\WebSphere MQ\errors log files. I couldn't find anything on them
Update
Based on Morag answer I changed my process name

You appear to have named your TriggerMonitor Service object in the queue attribute where you should put the process object name FetchMessages.

The Start Args for your trigger monitor Service object appears to be telling the trigger monitor to monitor the LocalQueue and not the InitQueue.

You need to make sure that the trigger monitor is running and has opened the initiation queue in INPUT(i.e. for GET) mode. Only then queue manager will put a trigger message into initiation queue. Here is what I did to get it working:
I did the setup just like you except for service. I manually started runmqtmc as
SET MQSERVER=<channel name>/TCP/<connname>
runmqtmc -m <qmname> -q <initq>
Put a test message on local queue. That triggered an event and my application started.

Related

MSMQ messages disappear when they get to remote server

I have to create a MSMQ messaging mechanism between two servers in the same domain, SenderServer (MS Server 2012) and ReceiverServer (MS Server 2008 R2).
I created a private, transactional queue in ReceiverServer .\private$\receiver, I gave receive (and peek) message rights to system and administrators.
I then created a client application that creates and forwards messages to the queue by using the following code:
MessageQueue queue = new queue("FormatName:Direct=OS:ReceiverServer\private$\receiver");
Message message = new Message();
message.Body = "myMessage";
using (MessageQueueTransaction tx = new MessageQueueTransaction())
{
tx.Begin();
queue.Send(message, "myLabel", tx);
tx.Commit();
}
Before deploying the application, I tested it from my machine (Windows 7) that correctly creates an outgoing queue Direct=OS:ReceiverServer\private$\receiver with State:Connected and Connection History:Connection is ready to transfer messages.
The messages are correctly sent to the ReceiverServer and placed in the \private$\receiver queue. The End2End log of the ReceiverServer for every message logs two events:
Message came over network (EventId: 4)
Message with ID CN=msmq, CN=[mymachinename], CN=Computers, DC=[domain], DC=[other] was put into queue ReceiverServer\private$\receiver (EventId: 1)
Then I used the client application from within the SenderServer using the same code. The server correctly creates an outgoing queue Direct=OS:ReceiverServer\private$\receiver with State:Connected and Connection History:Connection is ready to transfer messages, I can see the message queuing up and be sent but I do not receive them in the remote ReceiverServer queue .\private$\receiver. If I check the End2End event log of the ReceiverServer I just see the first message (Message came over network (EventId: 4)) but the message is not placed in the queue.
I turned off firewalls from both machines, changed the authorization settings for the queue and tried the following endpoint for the queues:
FormatName:Direct=OS:[IPv6 address]\private$\receiver
FormatName:Direct=TCP:ReceiverServer\private$\receiver
FormatName:Direct=TCP:[IPv6 address]\private$\receiver
With no luck. The troubleshooting process and the documentation from Microsoft are really general and simplistic, therefore I decided to ask here because for me is a dead end.
The sender domain account needs to have the following permissions on the remote queue: Send, Get Permissions, Get Properties
Are these machines on the same domain? If not you may need to grant the above permissions to the local user called ANONYMOUS LOGON
I ran into a similar problem and spend a few hours resolving it, so I wanted to post an answer to save others who may fall into the same trap I did.
When the queue was created on the remote server, it was mistakenly created as a transactional queue. However the code that was posting the messages was calling send without the transaction parameter. I could see the message at the sending workstation, but once it hit the destination server, it would disappear without any logging, journaling, or events to help determine why.
Once I identified the problem, I recreated the Queue as a non-transactional queue, and the issue was fixed.

Biztalk orchestration gets triggered by file adapter ahead of trigger message

We are trying to use the scheduled task adapter for triggering orchestration. Using the code sample linked below the adapter does not wait for the scheduled time to process order files, it processes the orders as soon as they are available. We are using the version 4.0 of the adapter on Biztalk 2010. Any help or sugesstion would be greatly appreciated.
BizTalk Scheduled Task Adapter
https://biztalkscheduledtask.codeplex.com/
BizTalk Server : Scheduling Orchestration using Trigger Message
http://social.technet.microsoft.com/wiki/contents/articles/25101.biztalk-server-scheduling-orchestration-using-trigger-message.aspx
If you are using the File Adapter, it looks like you are getting the expected result as the File Adapter will receive the file as soon as it's available.
With the Scheduled Task Adapter, you have to use the FileStreamProvider to receive the file at the scheduled time.
I'm familiar with the Scheduled Task adapter but if you want that a receive port picks up files during a part of the day => you can use the service window on the receive location.
https://msdn.microsoft.com/en-us/library/aa559260.aspx
Or do you have a different scenario in mind?

using vsftpd with inotify IN_CLOSE_WRITE event

I'm trying to write event based ftp server that notifies me when some user uploads any file(users will never do any delete or other stuff, they just upload). Apache ftpServer with ftplets is what I need but it is java based and does not satisfy my environment. So what I'm planning to do is to run vsftpd and another process besides it which listens to IN_CLOSE_WRITE event. When vsftpd close the file descriptor after finishing file upload, my process will be notified and I will do some appropriate action. My questions are:
Is it possible that I miss any file upload?
Is it possible that IN_CLOSE_WRITE fired in other situations that I get inconsistent files instead of ready to use files?
if the incrond service crashes or is stopped you will loose notification during that time
IN_CLOSE_WRITE should work.

What would cause a queue to be visible from other machines, but not the machine it was created on?

I created a public queue on Machine1 I can write to the queue (from asp.net) from Machine2. When I deploy the code to Machine1, I get the error:
Queue does not exist: Machine1\MyQueue.
Additionally you could check to see if the user which your IIS app pool is running under has permissions to write onto the local queue.
I expect main cause would be Machine 1 isn't in the same Active Directory forest as Machine 2.
What line of code raises the error message?
Cheers
John Breakwell

MSMQ cannot delete or purge a queue

I'm very new to MSMQ.
We have a critical system using MSMQ and it is not able to start due to insufficient resources. It appears that MSMQ is at capacity.
I am trying to purge messages (or even delete unneccessary queues), but I receive the following error when purging:
Cannot delete all messages from queue.
Error: Access to Message Queuing system is denied.
What are my options? Is there a way to delete queues when the services is off?
There's an easier way:
Open Computer Management on the machine,
expand the Services and Applications node (Features on 2008),
expand the Message Queuing service,
expand the private queues folder,
expand the private queue you're working with,
right click onto the queue messages folder and
click the purge option.
I think there is rights issue.
You are not able to give rights then do following step for forcefully delete queue.
Stop following services
Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.
Go to C:\Windows\System32\msmq\storage\lqs
Now open file in notepad or notepad++ and
see the name of queue at QueueName=\private$\YourQueueName
Before delete file backup the file. Now delete that file.
Don't delete other file which does not have your queue name.
Do these things as your own risk.
Now start following services
Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.
This trick work for me...
If you open Computer Management on the machine, expand the Services and Applications node (Features on 2008) and right-click on the Message Queuing service.
Right click on the Properties option and open it up to the General tab.
You can specify storage limits for messages -- you may have ran into the upper limit for messages storage. If you temporarily increase this value, it may allow you back into the messaging system so you can purge out those queues and restore operation.
Failing that, if you can deal with the loss of the messages (which if you are trying to purge I presume is okay), maybe delete the queue and recreate it.
Get hold of a copy of Queue Explorer - it's a commercial app but the trial is fully functional and it's worth it's weight in gold when debugging MSMQs http://www.cogin.com/mq/
If you don't have permissions though, then you don't have permissions! Are you a box admin? If you go to computermanagement and right click on one of your privete queues and select properties can you access the security tab and edit/see the permissions there?