Error message
When you call a High-speed Service Framework (HSF) service through the Taobao Open Platform (TOP) call method, the following error is returned:
There is no TOP transformer for Service:[${serviceUniqueName}].Cause
The TOP call method allows a gateway application to call backend services without depending on the service's API package. Instead of passing actual service types directly, the client sends generic parameters that a transformer on the server converts into the types the service expects.
This error means HSF cannot find a registered transformer for the target service. The transformer was either not registered during server initialization, or the registration did not complete successfully.
How the TOP call works
The TOP client sends parameters through the gateway application.
On the server, the
transformerconverts these parameters into the actual service types.HSF calls the target service with the converted parameters.
The
transformerconverts the service response back into a format the TOP client can consume.The response is returned to the TOP client.
If no transformer is registered at step 2, HSF returns the HSF-0029 error.
Solution
Verify that both the client and server are configured correctly for TOP-based calls.
Step 1: Verify the client configuration
The client must use com.taobao.hsf.app.spring.util.SuperHSFSpringConsumerBeanTop, which removes the dependency on the server's API package. Call the service through SuperHSFSpringConsumerBeanTop#invoke:
/**
* TOP calls this method to remotely access the HSF service.
* <p>
* The parameterTypes parameter indicates the type of the parameter of the method to be called.
* It must be a complete Java class name. If the parameter is an atomic type,
* the type is the name of the atomic type.
* </p>
*
* @return Returns the peer service response or service error.
*
* @throws HSFException
* If an error occurs at the local or peer HSF layer, HSFException is thrown.
* @throws Throwable
* If an error occurs on the server, Exception is thrown.
*/
public Object invoke(String methodName, String[] parameterTypes, Object[] args) throws HSFException, Throwable {
return consumerBeanTop.invoke(methodName, parameterTypes, args);
}Theargsparameter does not use the actual service type defined on the server. Thetransformeron the server side handles the type conversion.
Step 2: Register the transformer on the server
During server initialization, register a transformer by calling com.taobao.hsf.ServiceInvokeTransform.Helper#register. The transformer must implement two abstract methods:
/**
* Converts service call parameters into the format expected by the service.
*
* @param methodName
* The name of the service method to call.
* @param args
* The call parameters before conversion.
* @param parameterTypes
* The actual parameter types of the service method to call.
*/
abstract public Object[] transformRequest(String methodName, Object[] args, String[] parameterTypes)
throws Exception;
/**
* Converts the request parameter types.
*
* @param methodName
* The name of the service method to call.
* @param args
* The call parameters before conversion.
* @param parameterTypes
* The original parameter types before conversion.
* @return The converted parameter types.
* @throws Exception
*/
abstract public String[] transformRequestTypes(String methodName, Object[] args, String[] parameterTypes)
throws Exception;Make sure Helper#register is called during server initialization before any TOP client requests arrive. If the registration is missing or fails silently, HSF has no transformer to convert the incoming parameters, which triggers the HSF-0029 error.