Make message producer depends on InputStream (separated logic of creating input stream from message producing logic)