in file-bindy-ftp/src/main/java/org/acme/bindy/ftp/BookGenerator.java [62:84]
public void process(Exchange exchange) throws Exception {
Random random = new Random();
List<Book> books = new ArrayList<>();
for (int i = 0; i < 100; i++) {
String genre = BOOK_GENRES[random.nextInt(BOOK_GENRES.length)];
String description = BOOK_DESCRIPTION[random.nextInt(BOOK_DESCRIPTION.length)];
String title = String.format("The %s book of %s #%d", description, genre, i);
String firstName = FIRST_NAMES[random.nextInt(FIRST_NAMES.length)];
String lastName = LAST_NAMES[random.nextInt(LAST_NAMES.length)];
String author = String.format("%s %s", firstName, lastName);
Book book = new Book();
book.setId(i);
book.setAuthor(author);
book.setTitle(title);
book.setGenre(genre);
books.add(book);
}
exchange.getMessage().setBody(books);
}