Paramétrage de Talend SAP RFC

Le module SAP RFC de Talend est un broker intermédiaire entre SAP vers Talend ESB ou Talend ETL. Il récupère les messages IDoc produits par SAP S/4HANA, puis les dispose dans une instance ActiveMQ. Dans sa version actuelle, v7.2, il ne permet donc que les flux sortants de SAP.

Ce module est peu connu et assez mal documenté. Après quelques sueurs froides et de longues heures à chercher à le stabiliser et le optimiser, je vous partage mes réglages au sein d’un paramétrage robuste.

Instabilité en Production

La configuration standard Talend n’a jamais été stable sur l’environnement de Production d’un de mes clients. De nombreux redémarrages étaient nécessaires pour tenir le service ouvert. La performance était réduite.

Point de départ: la documentation Talend

Les références de paramétrage ne pas tout à fait exactes. Elles font référence à des pilotes JCO trop anciens. Elles permettent un fonctionnement “basique” mais ne sont pas suffisantes pour la “Production”.

Mes sources ont été principalement:

La source de vérité: la documentation SAP

Aussi étrange que cela paraisse, la documentation Talend ne fait pas référence à celle de SAP. – si mes yeux m’ont trompés, je vous remercie de m’en informer. –

Ma référence principale a été l’aide en ligne SAP sur

Connecteur SAP JCo

Paramétrage Talend SAP RFC Server

Le fichier tsap-rfc-server.properties porte le paramétrage d’échange entre ce module et SAP. Les éléments suivants forment le fichier complet.

Configuration SAP JCO

Cette partie porte la configuration protocolaire de la partie SAP.

Les paramètres les plus importants sont les

  • jco.destination.pool_capacity et
  • jco.destination.peak_limit

pour dépasser la connexion unique par défaut.

# -------------------------------------------------------------------------
# SAP JCO Server Section
# -------------------------------------------------------------------------
# SAP gateway host on which the RFC server should be registered
jco.server.gwhost=x.x.x.x

# SAP gateway service, i.e. the port used for the registration
jco.server.gwserv=3300

# The program ID with which the registration is done. Serves as identifier for IDOC
# on the gateway and as the destination in the SAP system
#jco.server.progid=TALEND

# also you can use this one for IDOC service
jco.server.progid.idoc=TALEND

# you can use this one for BW service
jco.server.progid.bw=TALEND

# Number of connections that should be registered at the gateway
jco.server.connection_count=10

#
# The number of threads that can be used by the JCoServer instance
# By default, same as connection count
#
#jco.server.worker_thread_count=10

#
# The number of threads, always kept running by JCoServer instance
# By default, same as connection count
#
#jco.server.worker_thread_min_count=10

# Enable/disable RFC trace (1=on or 0=off)
jco.server.trace=1

# -------------------------------------------------------------------------
# SAP JCO Client Section
# -------------------------------------------------------------------------
# Host name of the SAP ABAP application server
jco.client.ashost=x.x.x.x

# SAP client e.g. "000"
jco.client.client=100

# Logon language, if not defined the default user language will be used
jco.client.lang=en

# Logon user - Authenticates this server to SAP
jco.client.user=talend_rfc

# Logon password - Authenticates this server to SAP
jco.client.passwd=motdepasse

# System number of the SAP ABAP application server
jco.client.sysnr=00

# -------------------------------------------------------------------------
# SAP JCO Connexions Pool Section
# -------------------------------------------------------------------------
## SAP: Delays and expirations
jco.destination.max_get_client_time=30000
jco.destination.expiration_time=60000
jco.destination.expiration_check_period=15000

# SAP: checks
jco.destination.pool_check_connection=1 

## SAP: Pools to SAP
jco.destination.pool_capacity=5
jco.destination.peak_limit=10

Configuration Management IDoc

Aucun management n’a été utilisé.

# -------------------------------------------------------------------------
# Server management Section
# ------------------------------------------------------------------------- 

# The number of threads in the fixed size pool servicing SAP Idocs
rfc.server.thread.pool.size=10 

# The IP address on which to listen for shutdown commands
#rfc.server.shutdown.address=localhost 

# The port number on which to listen for shutdown commands
#rfc.server.shutdown.port=16161

# The shutdown command expected
#rfc.server.shutdown.command=SHUTDOWN

# How long to wait for shutdown to complete (milliseconds)
#rfc.server.shutdown.timout=60000 

# The folder containing user libraries, particularly sapjco3.jar
#rfc.server.user.lib.folder=user/lib

Configuration Réception IDOC

Il est primordial d’activer le support transactionnel sur la réception d’ IDoc, paramètre “receiver.transactional”. Ainsi les erreurs ou les non traitements seront remontées à SAP. Sans cela les messages seraient stockés sans lien avec SAP.

# -------------------------------------------------------------------------
# IDocs Receiver Section
# -------------------------------------------------------------------------
#
# The class name of a substitute receiver factory. Used for testing
# primarily
#receiver.server.factory.class.name=org.talend.sap.idocs.mock.SAPServerFactoryMock

# Whether the receiver should be transactional
receiver.transactional=true

#
# In transactional mode:
# Timeout in milliseconds, used on waiting for the IDOC package to get
# processed (commit or rollback is called). If it is not processed within
# this time, the IDOC transaction is automatically aborted
#
api.idoc_transaction_wait_timout=300000

Configuration ActiveMQ interne

Le module porte un ActiveMQ, interne ou externe. Il est paramétré, ci-dessous, sans particularité.

# -------------------------------------------------------------------------
# JMS Broker Section
# -------------------------------------------------------------------------
#
# The host address and port (ex tcp://localhost:61616) for the JMS broker
# to listen for incoming connections
#
rfc.server.jms.bind.address=0.0.0.0

# Whether JMS messages are persisted or not
rfc.server.jms.persistence=true

# File system location used by JMS broker to persist data
rfc.server.jms.data.directory=/data/sap-rfc-server

# File system directory containing jaas authentication configuration
#rfc.server.jms.login.config=

# A jaas username used to authenticate a publisher or sender
#rfc.server.jms.login.username=

# A jaas password used to authenticate a publisher or sender
#rfc.server.jms.login.password=

# The path to a key store for SSL
#rfc.server.jms.ssl.keystore.path=

# A password for a key store for SSL
#rfc.server.jms.ssl.keystore.password=

# Whether JMS messages should be replicated in durable queues
rfc.server.jms.replicate.in.durable.queues=true

# ISO8601 retention period for JMS messages in durable queues
rfc.server.jms.durable.queues.retention.period=P7D

La partie ActiveMQ peut-être combinée à un paramétrage Maitre-Esclave pour garantir la disponibilité et la robustesse du service.

Stabilité du module

Avec cette configuration, le module SAP RFC de Talend est maintenant stable et performant en Production 🙂 !

Laisser un commentaire