[ 
https://issues.apache.org/jira/browse/CXF-8383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17245922#comment-17245922
 ] 

olivier dufour commented on CXF-8383:
-------------------------------------

hello,

I have found a solution by implementing wrapper servlet request and response 
with vertx routingConfig in it.

Most of things must work. but I am stuck with registration of transport.

I have register my custom transport with

DestinationFactoryManager dfm = 
this.bus.getExtension(DestinationFactoryManager.class);
destinationFactory = new VertxDestinationFactory();
dfm.registerDestinationFactory("http://cxf.apache.org/transports/quarkus";, 
destinationFactory);
ConduitInitiatorManager extension = 
bus.getExtension(ConduitInitiatorManager.class);
extension.registerConduitInitiator("http://cxf.apache.org/transports/quarkus";, 
destinationFactory);
bus.setExtension(destinationFactory, HttpDestinationFactory.class);

 

when I handle vertx request

I call 

((VertxDestination) d).invoke(event);

 
{code:java}
public class VertxDestination extends JAXWSHttpSpiDestination {

 public VertxDestination(EndpointInfo endpointInfo, Bus bus, 
DestinationRegistry destinationRegistry) throws IOException {
 super(bus, destinationRegistry, endpointInfo);
 }

 @Override
 protected Logger getLogger() {
 return null;
 }

 @Override
 public EndpointReferenceType getAddress() {
 return super.getAddress();
 }

 public void invoke(RoutingContext context) throws IOException {
 VertxHttpServletRequest req = new VertxHttpServletRequest(context);
 VertxHttpServletResponse resp = new VertxHttpServletResponse(context);
 doService(req, resp);

 }
}{code}
The issue is that I get an exception:

java.lang.NullPointerException
 at 
org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.serviceRequest(JAXWSHttpSpiDestination.java:95)
 at 
org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination.doService(JAXWSHttpSpiDestination.java:68)
 at 
io.quarkiverse.cxf.transport.VertxDestination.invoke(VertxDestination.java:33)
 at io.quarkiverse.cxf.transport.CxfHandler.process(CxfHandler.java:272)
 at io.quarkiverse.cxf.transport.CxfHandler.handle(CxfHandler.java:189)
 at io.quarkiverse.cxf.transport.CxfHandler.handle(CxfHandler.java:37)
 at 
io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)
 at 
io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)

 

it mean that incomingObserver is null.

But what is the purpose of this incomingObserver and why it is null is a 
mystery to me. So if you could enlight me. I will be thanksfull.

> cxf support for vertx destination
> ---------------------------------
>
>                 Key: CXF-8383
>                 URL: https://issues.apache.org/jira/browse/CXF-8383
>             Project: CXF
>          Issue Type: New Feature
>          Components: Transports
>            Reporter: olivier dufour
>            Priority: Major
>             Fix For: 3.4.1
>
>
> Hello,
> I am working on cxf quarkus extension. And quarkus is migrating from servlet 
> to vertx routing system.  Anyway, I try to make a custom detination/conduit 
> but it seems that cxf have tight integration with servlet. I try to make my 
> own invoke with 
> HttpServerRequest req, HttpServerResponse res, RoutingContext ctx
> instead of
> invoke(final ServletConfig config, final ServletContext context, final 
> HttpServletRequest req,
>  final HttpServletResponse resp)
> but when I see that InMessage store servlet request and servlet response as 
> attribute, I am affraid that this not doable. 
> So, Another solution is to do a wrapper httpServletRequest class which wrap 
> the vertx httpserverrequest. 
>  
> Anyway, in term of architecture, why inMessage do not store body, uri, query 
> param, ... instead of the servlet objects (request, context)?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to