In-network processing, involving operations such as filtering, compression and fusion, is widely used in sensor networks to reduce the communication overhead. In many tactical and stream-oriented wireless network applications, both link bandwidth and node energy are critically constrained resources and in-network processing itself imposes non-negligible computing cost. In this work, we have developed a unified and distributed closed-loop control framework that computes both a) the optimal level of sensor stream compression performed by a forwarding node, and b) the best set of nodes where the stream processing operators should be deployed. Our framework extends the Network Utility Maximization (NUM) paradigm, where resource sharing among competing applications is modeled as a form of distributed utility maximization. We also show how our model can be adapted to more realistic cases, where in-network compression may be varied only discretely, and where a fusion operation cannot be fractionally distributed across multiple nodes.