Fix EOF handling in the queue

Also handle exceptions in event handler loop
Add publisher configuration checking
Fix getting publisher