camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton <kurren...@gmail.com>
Subject Clarification on how Converters work with CDI
Date Wed, 13 Apr 2016 10:46:45 GMT
Hello

Im trying to use a camel type converter with Camel CDI.

My converter looks like the following:

@Converter
@SuppressWarnings("all")
public class TicketConverter {

  @Converter
  public SupportRequest convertToSupportRequest(final Ticket ticket) {
    SupportRequest sr = new SupportRequest();
    String _subject = ticket.getSubject();
    sr.setName(_subject);
    return sr;
  }
}

Then I have the following route:
public void configure() {

    from(ticketEndpoint) // returns a Ticket
    .to("jpa:my.domain.SupportRequest&persistenceUnit=camel"); // attempt
to persist SupportRequest
    }

Implicitly Transforming from Ticket to SupportRequest does not seem to
occur. In the JPA endpoint, it still tries to persist a Ticket object.

How do I tell camel to transform from Ticket to SupportRequest?

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message