title: Spring prototype beans with parameters?
body: <p>Is it possible to define a <strong>prototype bean</strong>, using XML config or annotation-based config such that I can get an instance of the bean with a custom parameter value? My use case is a message queue handler that makes API calls with different parameter values that are supplied in the inbound message.</p>
  
  <p>In this case it seems I can do one of two things:</p>
  
  <ul>
  <li>Get an instance of my prototype-scope bean and then call setters to customize it to be specific to the inbound message.</li>
  <li>Construct a new instance of the bean class using a plain <code>new MyPrototypeBean()</code> and then call setters to customize the instance.</li>
  </ul>
  
  <p>Perhaps a different way of wording my question is: What is the benefit of using a prototype-scope bean vs. using a simple Java constructor?</p>