You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Garbage <ga...@gmx.de> on 2015/11/23 09:17:13 UTC

Use netty4 to retrieve netcat style print jobs and process them

I asked a question on stackoverflow and already got valuable input from Claus Ibsen. But      I have doubt if what I am after is feasible.

I want to attach a self written program to a legacy application that is able to print to local host connected tcp printer. This can be simulated by using netcat and is ever more basic than lpr (for those interested: I am talking about Epson esc pos printers like Tm-T 88 which have an Ethernet interface)
In want to identify "Print Jobs" that means simply grabbing single bytes or lines is not enough. I need to know when a job was sent and when a new one starts. The testprogram I already created is not able to recognize this and receives the data in 1kb, 2kb, 4kb, ... packages.

The idea is to forward jobs to a jams queue and have it handled there. To make it even more difficult I have to intercept certain print job which simply consist of two bytes because they ask for the printers status. To simplify this I would not forward them to the queue and instead reply with a "everything is ok, you can print"

My two concerns are:
- is it possible to write a codec that detects the end of a print job ?
- how to implement the route that has a look at the print job before forwarding it to the queue ?