Ionic liquid reactor with heat exchanger